Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] LLVM 15
@ 2022-11-28 15:30 tranzystorek-io
  2022-11-28 15:32 ` tranzystorek-io
                   ` (94 more replies)
  0 siblings, 95 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-11-28 15:30 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm15-40821.patch --]
[-- Type: text/x-diff, Size: 182741 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/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 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/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 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/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                          | 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/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 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/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 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/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 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/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 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/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 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/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 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/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 | 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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"
 

From 32525df162b4142a42daa64cccfff65f2af221a2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH 38/38] llvm: update to 15.0.5

---
 common/shlibs                                 |   4 +
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 433 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1146 insertions(+), 20 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index a8c3a244f9ac..461e5da63191 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,10 +985,14 @@ libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
 liblldb.so.12 lldb-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
 libclang.so.12 libclang-12.0.0_1
+libclang.so.15 libclang-15.0.5_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..d80c629c4778
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,433 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.5
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9c4278a6b8884eb7f4ae7dfe3c8e5445019824885e47cfdf1392563c47316fd6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/man/man1/scan-build.1
+		vmove "/usr/bin/scan-*"
+		vmove "/usr/share/scan-*"
+		vmove "/usr/libexec/*analyzer"
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/include/clang-tidy
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+		vmove usr/share/man/man1/diagtool.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/include/*unwind*"
+		vmove usr/include/mach-o
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+		vmove "usr/include/*cxxabi*"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/include/c++
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove usr/lib/libarcher.so
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
@ 2022-11-28 15:32 ` tranzystorek-io
  2022-11-28 16:36 ` dkwo
                   ` (93 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-11-28 15:32 UTC (permalink / raw)
  To: ml

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

New comment by tranzystorek-io on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1329304996

Comment:
For now working on top of #34902 

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
  2022-11-28 15:32 ` tranzystorek-io
@ 2022-11-28 16:36 ` dkwo
  2022-11-28 19:13 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (92 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: dkwo @ 2022-11-28 16:36 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1329396063

Comment:
You may want to look at the previous PR (for 14) for inspiration, as well as chimera and alpine for patches.
Some stuff will need rebuild (e.g. mesa), and maybe update zig to 10.

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
  2022-11-28 15:32 ` tranzystorek-io
  2022-11-28 16:36 ` dkwo
@ 2022-11-28 19:13 ` tranzystorek-io
  2022-11-28 23:49 ` tranzystorek-io
                   ` (91 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-11-28 19:13 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm15-40821.patch --]
[-- Type: text/x-diff, Size: 183360 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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"
 

From 838269d4eb60aec325fc19e4a4f8f8fb795983de Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH 38/38] llvm: update to 15.0.5

---
 common/shlibs                                 |   4 +
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 433 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1146 insertions(+), 20 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 5a0ad39c8da8..11d906c699cf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,10 +985,14 @@ libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
 liblldb.so.12 lldb-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
 libclang.so.12 libclang-12.0.0_1
+libclang.so.15 libclang-15.0.5_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..d80c629c4778
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,433 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.5
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9c4278a6b8884eb7f4ae7dfe3c8e5445019824885e47cfdf1392563c47316fd6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/man/man1/scan-build.1
+		vmove "/usr/bin/scan-*"
+		vmove "/usr/share/scan-*"
+		vmove "/usr/libexec/*analyzer"
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/include/clang-tidy
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+		vmove usr/share/man/man1/diagtool.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/include/*unwind*"
+		vmove usr/include/mach-o
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+		vmove "usr/include/*cxxabi*"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/include/c++
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove usr/lib/libarcher.so
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (2 preceding siblings ...)
  2022-11-28 19:13 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2022-11-28 23:49 ` tranzystorek-io
  2022-11-29  0:31 ` tranzystorek-io
                   ` (90 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-11-28 23:49 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm15-40821.patch --]
[-- Type: text/x-diff, Size: 183396 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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"
 

From 5d8ffd97de012561ebfc5eda19a3d7e3f0c5e23c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH 38/38] llvm: update to 15.0.5

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 433 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1146 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 5a0ad39c8da8..0ae10484b362 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -984,11 +984,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
+libclang.so.15 libclang-15.0.5_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..d80c629c4778
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,433 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.5
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9c4278a6b8884eb7f4ae7dfe3c8e5445019824885e47cfdf1392563c47316fd6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove usr/share/man/man1/scan-build.1
+		vmove "/usr/bin/scan-*"
+		vmove "/usr/share/scan-*"
+		vmove "/usr/libexec/*analyzer"
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/include/clang-tidy
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+		vmove usr/share/man/man1/diagtool.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/include/*unwind*"
+		vmove usr/include/mach-o
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+		vmove "usr/include/*cxxabi*"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/include/c++
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove usr/lib/libarcher.so
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/lib/libomp*.so"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (3 preceding siblings ...)
  2022-11-28 23:49 ` tranzystorek-io
@ 2022-11-29  0:31 ` tranzystorek-io
  2022-12-05  8:05 ` tranzystorek-io
                   ` (89 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-11-29  0:31 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm15-40821.patch --]
[-- Type: text/x-diff, Size: 183423 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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"
 

From 8375e2563398aed2ea8d860557c4347b6b6381fa Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH 38/38] llvm: update to 15.0.5

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1147 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 5a0ad39c8da8..0ae10484b362 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -984,11 +984,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
+libclang.so.15 libclang-15.0.5_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..7c08c890d8c3
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.5
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9c4278a6b8884eb7f4ae7dfe3c8e5445019824885e47cfdf1392563c47316fd6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (4 preceding siblings ...)
  2022-11-29  0:31 ` tranzystorek-io
@ 2022-12-05  8:05 ` tranzystorek-io
  2022-12-05  8:17 ` tranzystorek-io
                   ` (88 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-05  8:05 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm15-40821.patch --]
[-- Type: text/x-diff, Size: 183423 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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"
 

From e2b48842758ad97e7d95d65e0659d140e2d8f644 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH 38/38] llvm: update to 15.0.5

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1147 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 3f90cbd1ace3..8afb88b47e23 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,11 +985,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
+libclang.so.15 libclang-15.0.5_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..7c08c890d8c3
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.5
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9c4278a6b8884eb7f4ae7dfe3c8e5445019824885e47cfdf1392563c47316fd6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (5 preceding siblings ...)
  2022-12-05  8:05 ` tranzystorek-io
@ 2022-12-05  8:17 ` tranzystorek-io
  2022-12-05  8:22 ` [PR REVIEW] " oreo639
                   ` (87 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-05  8:17 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm15-40821.patch --]
[-- Type: text/x-diff, Size: 181863 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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"
 

From 3e3ef0cf5e9b7a3d2ef811e07ed1dfa233b1a4f4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH 38/38] llvm: update to 15.0.5

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 40 files changed, 1121 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 3f90cbd1ace3..8afb88b47e23 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,11 +985,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
+libclang.so.15 libclang-15.0.5_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..7c08c890d8c3
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.5
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9c4278a6b8884eb7f4ae7dfe3c8e5445019824885e47cfdf1392563c47316fd6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (6 preceding siblings ...)
  2022-12-05  8:17 ` tranzystorek-io
@ 2022-12-05  8:22 ` oreo639
  2022-12-05  8:22 ` oreo639
                   ` (86 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  8:22 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039282833

Comment:
libexecinfo in LLVM is optional. Don't enable it. (it doesn't work)

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (7 preceding siblings ...)
  2022-12-05  8:22 ` [PR REVIEW] " oreo639
@ 2022-12-05  8:22 ` oreo639
  2022-12-05  8:29 ` oreo639
                   ` (85 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  8:22 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039282833

Comment:
libexecinfo in LLVM is optional and isn't used if the headers don't exist. Don't enable it. (it doesn't work anyway)

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (8 preceding siblings ...)
  2022-12-05  8:22 ` oreo639
@ 2022-12-05  8:29 ` oreo639
  2022-12-05  8:29 ` oreo639
                   ` (84 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  8:29 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039282833

Comment:
Don't enable libexecinfo, it doesn't work. LLVM can compile perfectly fine without libexecinfo.

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (9 preceding siblings ...)
  2022-12-05  8:29 ` oreo639
@ 2022-12-05  8:29 ` oreo639
  2022-12-05  8:30 ` oreo639
                   ` (83 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  8:29 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039282833

Comment:
Don't enable libexecinfo, it doesn't work. LLVM can compile without libexecinfo (it checks during configure-time if the headers exist).

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (10 preceding siblings ...)
  2022-12-05  8:29 ` oreo639
@ 2022-12-05  8:30 ` oreo639
  2022-12-05  8:39 ` oreo639
                   ` (82 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  8:30 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039282833

Comment:
Don't enable libexecinfo, it doesn't work and usually just segfaults. LLVM can compile without libexecinfo (it checks during configure-time if the headers exist).

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (11 preceding siblings ...)
  2022-12-05  8:30 ` oreo639
@ 2022-12-05  8:39 ` oreo639
  2022-12-05  9:28 ` oreo639
                   ` (81 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  8:39 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039282833

Comment:
Don't enable libexecinfo, it doesn't work and usually just segfaults.
LLVM can compile without libexecinfo (it just uses its own implementation).

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (12 preceding siblings ...)
  2022-12-05  8:39 ` oreo639
@ 2022-12-05  9:28 ` oreo639
  2022-12-05  9:55 ` oreo639
                   ` (80 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  9:28 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039347984

Comment:
Also remove this (same reason as above, libexecinfo doesn't work, llvm has its own implementation as a fallback)

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (13 preceding siblings ...)
  2022-12-05  9:28 ` oreo639
@ 2022-12-05  9:55 ` oreo639
  2022-12-05  9:55 ` oreo639
                   ` (79 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  9:55 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039347984

Comment:
Also remove this (same reason as above, libexecinfo doesn't work, llvm has its own implementation as a fallback)

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (14 preceding siblings ...)
  2022-12-05  9:55 ` oreo639
@ 2022-12-05  9:55 ` oreo639
  2022-12-06 10:11 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (78 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-05  9:55 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1039282833

Comment:
Don't enable libexecinfo, it doesn't work and usually just segfaults.
LLVM can compile without libexecinfo (it just uses its own implementation).

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (15 preceding siblings ...)
  2022-12-05  9:55 ` oreo639
@ 2022-12-06 10:11 ` tranzystorek-io
  2022-12-07  5:04 ` Vaelatern
                   ` (77 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-06 10:11 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm15-40821.patch --]
[-- Type: text/x-diff, Size: 183423 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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 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/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"
 

From 2d2c87fb5e63ef0d1ce567ce44b4043ba632f37b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH 38/38] llvm: update to 15.0.6

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1147 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 3f90cbd1ace3..8afb88b47e23 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,11 +985,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
+libclang.so.15 libclang-15.0.5_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..5ed8be136668
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (16 preceding siblings ...)
  2022-12-06 10:11 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2022-12-07  5:04 ` Vaelatern
  2022-12-07  5:04 ` Vaelatern
                   ` (76 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: Vaelatern @ 2022-12-07  5:04 UTC (permalink / raw)
  To: ml

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

New comment by Vaelatern on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1340377927

Comment:
```
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9d..f453348a7a0 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,7 +1,7 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.0
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
@@ -11,7 +11,7 @@ maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=d8409f7aafc624770dcd050c8fa7e62578be8e6a10956bca3c86e8531c64c136
 nopie=yes
 nocross=yes

```

Could use the update :)

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (17 preceding siblings ...)
  2022-12-07  5:04 ` Vaelatern
@ 2022-12-07  5:04 ` Vaelatern
  2022-12-12 18:26 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (75 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: Vaelatern @ 2022-12-07  5:04 UTC (permalink / raw)
  To: ml

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

New comment by Vaelatern on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1340377927

Comment:
```
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9d..f453348a7a0 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,7 +1,7 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.0
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
@@ -11,7 +11,7 @@ maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=d8409f7aafc624770dcd050c8fa7e62578be8e6a10956bca3c86e8531c64c136
 nopie=yes
 nocross=yes

```

Could use the update and needs llvm 15.

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (18 preceding siblings ...)
  2022-12-07  5:04 ` Vaelatern
@ 2022-12-12 18:26 ` tranzystorek-io
  2022-12-17  8:56 ` tranzystorek-io
                   ` (74 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-12 18:26 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-llvm15-40821.patch --]
[-- Type: text/x-diff, Size: 184267 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/39] 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/39] 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/39] 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/39] 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/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 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/39] 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/39] 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/39] 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/39] 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/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 -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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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/39] 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"
 

From 9946827e507def83a3ac2a9be2b51ba1baad20dc Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH 39/39] llvm: update to 15.0.6

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1147 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 7ce556ce7ac2..883377b1bbf5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,11 +985,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
+libclang.so.15 libclang-15.0.5_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..5ed8be136668
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (19 preceding siblings ...)
  2022-12-12 18:26 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2022-12-17  8:56 ` tranzystorek-io
  2022-12-17  9:00 ` tranzystorek-io
                   ` (73 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-17  8:56 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

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

From 4dc58e5e8ffc45bc179f1a77861800574a63536b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH] llvm: update to 15.0.6

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1147 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index ba5c89ee3bad..fe79d476f1dd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,11 +982,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
+libclang.so.15 libclang-15.0.5_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..d14430090161 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,10 +1,10 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..5ed8be136668
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (20 preceding siblings ...)
  2022-12-17  8:56 ` tranzystorek-io
@ 2022-12-17  9:00 ` tranzystorek-io
  2022-12-17  9:09 ` tranzystorek-io
                   ` (72 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-17  9:00 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

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

From b5ebe5cfe7ba9c658cda2026a6eac110dc11ba10 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH] llvm: update to 15.0.6

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1147 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index ba5c89ee3bad..fe79d476f1dd 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,11 +982,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.5_1
+libclang.so.15 libclang-15.0.5_1
+libclang-cpp.so.15 libclang-cpp-15.0.5_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.5_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..3e050c14d38f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..5ed8be136668
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (21 preceding siblings ...)
  2022-12-17  9:00 ` tranzystorek-io
@ 2022-12-17  9:09 ` tranzystorek-io
  2022-12-17 10:44 ` [PR REVIEW] " paper42
                   ` (71 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-17  9:09 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

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

From b6dd9ce03bb933fe662c97d20c7e082e9532de32 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 27 Nov 2022 22:59:45 +0100
Subject: [PATCH] llvm: update to 15.0.6

---
 common/shlibs                                 |   7 +-
 srcpkgs/clang                                 |   2 +-
 srcpkgs/clang-analyzer                        |   2 +-
 srcpkgs/clang-tools-extra                     |   2 +-
 srcpkgs/libclang                              |   2 +-
 srcpkgs/libclang-cpp                          |   2 +-
 srcpkgs/libcxx                                |   2 +-
 srcpkgs/libcxx-devel                          |   2 +-
 srcpkgs/libcxxabi                             |   2 +-
 srcpkgs/libcxxabi-devel                       |   2 +-
 srcpkgs/libllvm15                             |   1 +
 srcpkgs/libomp                                |   2 +-
 srcpkgs/libomp-devel                          |   2 +-
 srcpkgs/lld                                   |   2 +-
 srcpkgs/lld-devel                             |   2 +-
 srcpkgs/lldb                                  |   2 +-
 srcpkgs/lldb-devel                            |   2 +-
 srcpkgs/llvm-libunwind                        |   2 +-
 srcpkgs/llvm-libunwind-devel                  |   2 +-
 srcpkgs/llvm/template                         |   6 +-
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 41 files changed, 1147 insertions(+), 23 deletions(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index ba5c89ee3bad..7b8d77766f0f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,11 +982,12 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..3e050c14d38f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.0
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..5ed8be136668
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (22 preceding siblings ...)
  2022-12-17  9:09 ` tranzystorek-io
@ 2022-12-17 10:44 ` paper42
  2022-12-17 23:41 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (70 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: paper42 @ 2022-12-17 10:44 UTC (permalink / raw)
  To: ml

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

New review comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1051382686

Comment:
this should be in a separate commit, "New package: llvm15-15.0.6"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (23 preceding siblings ...)
  2022-12-17 10:44 ` [PR REVIEW] " paper42
@ 2022-12-17 23:41 ` tranzystorek-io
  2022-12-18  0:02 ` [PR REVIEW] " oreo639
                   ` (69 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-17 23:41 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

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

From d2840687e08adbad5a91eace4e52709c74d094e4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 1/2] New package: llvm15-15.0.6

---
 common/shlibs                                 |   1 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1124 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index ba5c89ee3bad..3cb919b3ce3b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,6 +987,7 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..5ed8be136668
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 0fd6e120ba3576b7f8ed6fc8ec9a64a26b7bca6b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 2/2] llvm: update to 15.0.6

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 3cb919b3ce3b..7b8d77766f0f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,9 +982,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..7f04a8f8a7a4 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.6
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (24 preceding siblings ...)
  2022-12-17 23:41 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2022-12-18  0:02 ` oreo639
  2022-12-18  0:03 ` oreo639
                   ` (68 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-18  0:02 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1051500505

Comment:
llvm12 currently provides clang et al, which should be removed:
https://github.com/void-linux/void-packages/commit/0d9f8330b556561ee38de7d6a0d4280f56cdd58e

Also, you need to rebuild/update everything depending on llvm.

Here is the llvm12 update for reference:
https://github.com/void-linux/void-packages/commits/e8c2d0e32888730ad5fa16e1441de1a4e1a3a64a

Ofc a bunch of stuff was updated after that (i.e. rust, ldc, etc) but just for reference.

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (25 preceding siblings ...)
  2022-12-18  0:02 ` [PR REVIEW] " oreo639
@ 2022-12-18  0:03 ` oreo639
  2022-12-18  0:05 ` oreo639
                   ` (67 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-18  0:03 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1051500505

Comment:
llvm12 currently provides clang et al, which should be removed:
https://github.com/void-linux/void-packages/commit/0d9f8330b556561ee38de7d6a0d4280f56cdd58e

Also, you need to rebuild/update everything depending on llvm.

Here is the llvm12 update for reference:
https://github.com/void-linux/void-packages/commits/e8c2d0e32888730ad5fa16e1441de1a4e1a3a64a

Ofc a bunch of stuff was updated after that which depended on llvm11 instead of the llvm package (i.e. rust, ldc, etc) but just for reference.

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (26 preceding siblings ...)
  2022-12-18  0:03 ` oreo639
@ 2022-12-18  0:05 ` oreo639
  2022-12-18 11:24 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (66 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-18  0:05 UTC (permalink / raw)
  To: ml

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

New review comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1051500505

Comment:
llvm12 currently provides clang et al, which should be removed:
https://github.com/void-linux/void-packages/commit/0d9f8330b556561ee38de7d6a0d4280f56cdd58e

Also, you need to rebuild/update everything depending on llvm.

Here is the llvm12 update for reference:
https://github.com/void-linux/void-packages/commits/e8c2d0e32888730ad5fa16e1441de1a4e1a3a64a

Ofc a bunch of stuff was updated after that which depended on llvm11 instead of the llvm package (i.e. rust, ldc, etc) which should probably be updated as well but just for reference.

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (27 preceding siblings ...)
  2022-12-18  0:05 ` oreo639
@ 2022-12-18 11:24 ` tranzystorek-io
  2022-12-18 23:30 ` tranzystorek-io
                   ` (65 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-18 11:24 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

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

From d2840687e08adbad5a91eace4e52709c74d094e4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 1/3] New package: llvm15-15.0.6

---
 common/shlibs                                 |   1 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1124 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index ba5c89ee3bad..3cb919b3ce3b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,6 +987,7 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..5ed8be136668
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 0fd6e120ba3576b7f8ed6fc8ec9a64a26b7bca6b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 2/3] llvm: update to 15.0.6

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 3cb919b3ce3b..7b8d77766f0f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,9 +982,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..7f04a8f8a7a4 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15.0.6
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 4841f398dbf0dd717032b816410d00dc3aef4c4d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 3/3] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (28 preceding siblings ...)
  2022-12-18 11:24 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2022-12-18 23:30 ` tranzystorek-io
  2022-12-19 23:58 ` oreo639
                   ` (64 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2022-12-18 23:30 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

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

From 6026474aac3020c009c9d0bc13cf3f159a29e915 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 1/3] New package: llvm15-15.0.6

---
 common/shlibs                                 |   1 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 434 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1124 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index ba5c89ee3bad..3cb919b3ce3b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,6 +987,7 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..5ed8be136668
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,434 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libomp.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From d0d21076330cc6c196457358c1cec9d2bd3608e3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 2/3] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 3cb919b3ce3b..7b8d77766f0f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -982,9 +982,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 4fa6150a5648d2767756f973b775a3856648426a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 3/3] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (29 preceding siblings ...)
  2022-12-18 23:30 ` tranzystorek-io
@ 2022-12-19 23:58 ` oreo639
  2022-12-19 23:59 ` oreo639
                   ` (63 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-19 23:58 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/40821#issuecomment-1358644729

Comment:
Here is a patch to fix building on musl:
https://gist.github.com/oreo639/a43b23916774fe58910bffce6a848190

It includes a patch that partially reverts:
https://github.com/llvm/llvm-project/commit/67b0b02ec9f2bbc57bf8f0550828d97f460ac11f

That is necessary to fix usage of abi_tag() on an extern "C" declaration which is explicitly not allowed in gcc:
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/tree.cc#L5350-L5355

This also disables GWP-ASan/`-fsanitize=scudo` since it depends on the broken libexecinfo and GWP-ASan also gets into an infinite loop on musl.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (30 preceding siblings ...)
  2022-12-19 23:58 ` oreo639
@ 2022-12-19 23:59 ` oreo639
  2022-12-20  0:04 ` oreo639
                   ` (62 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-19 23:59 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1358644729

Comment:
Here is a patch to fix building on musl:
https://gist.github.com/oreo639/a43b23916774fe58910bffce6a848190

It includes a patch that partially reverts:
https://github.com/llvm/llvm-project/commit/67b0b02ec9f2bbc57bf8f0550828d97f460ac11f

That is necessary to fix usage of abi_tag() on an extern "C" declaration which is explicitly not allowed in gcc:
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/tree.cc#L5350-L5355

This also disables GWP-ASan/`-fsanitize=scudo` since it depends on libexecinfo (which doesn't work correctly) and GWP-ASan also gets into an infinite loop on musl.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (31 preceding siblings ...)
  2022-12-19 23:59 ` oreo639
@ 2022-12-20  0:04 ` oreo639
  2022-12-20  0:09 ` oreo639
                   ` (61 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-20  0:04 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1358644729

Comment:
Here is a patch to fix building on musl:
https://gist.github.com/oreo639/a43b23916774fe58910bffce6a848190

It includes a patch that partially reverts:
https://reviews.llvm.org/D124227

That is necessary to fix usage of abi_tag() on an extern "C" declaration which is explicitly not allowed in gcc:
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/tree.cc#L5350-L5355

This also disables GWP-ASan/`-fsanitize=scudo` since it depends on libexecinfo (which doesn't work correctly) and GWP-ASan also gets into an infinite loop on musl.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (32 preceding siblings ...)
  2022-12-20  0:04 ` oreo639
@ 2022-12-20  0:09 ` oreo639
  2022-12-22  4:26 ` simvux
                   ` (60 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-20  0:09 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1358644729

Comment:
Here is a patch to fix building on musl:
https://gist.github.com/oreo639/a43b23916774fe58910bffce6a848190

It includes a patch that partially reverts:
https://reviews.llvm.org/D124227

That is necessary to fix usage of abi_tag() on an extern "C" declaration which is explicitly not allowed in gcc:
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/tree.cc#L5350-L5355

This also disables GWP-ASan/`-fsanitize=scudo` on musl since it depends on libexecinfo (which doesn't work correctly) and GWP-ASan also gets into an infinite loop on musl.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (33 preceding siblings ...)
  2022-12-20  0:09 ` oreo639
@ 2022-12-22  4:26 ` simvux
  2022-12-22  4:48 ` oreo639
                   ` (59 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: simvux @ 2022-12-22  4:26 UTC (permalink / raw)
  To: ml

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

New comment by simvux on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1362396404

Comment:
I believe this is required for mesa to work correctly with the new rx 7000s series amd GPU's. So to make them plug ń play we'll need to both merge this and swap the depedency in `mesa` from `llvm` to `llvm15`. 

FWIW; merging this branch into #41084 and changing #41084 to `llvm15` worked for me, but I also needed to fetch the latest `linux-firmware-amd` blobs, update `SPIRV-{Headers,LLVM-Translator}`, hack some stuff into `shlibs` which I'm not familiar with. 

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (34 preceding siblings ...)
  2022-12-22  4:26 ` simvux
@ 2022-12-22  4:48 ` oreo639
  2022-12-22 10:15 ` ardadem
                   ` (58 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2022-12-22  4:48 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1362413705

Comment:
llvm is llvm15 in this PR. mesa just needs to be rebuilt.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (35 preceding siblings ...)
  2022-12-22  4:48 ` oreo639
@ 2022-12-22 10:15 ` ardadem
  2023-01-05 14:13 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (57 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: ardadem @ 2022-12-22 10:15 UTC (permalink / raw)
  To: ml

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

New comment by ardadem on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1362656204

Comment:
SPIRV-LLVM-Translator should match the llvm version so please update that as well.

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (36 preceding siblings ...)
  2022-12-22 10:15 ` ardadem
@ 2023-01-05 14:13 ` tranzystorek-io
  2023-01-06 12:39 ` [PR REVIEW] " tranzystorek-io
                   ` (56 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-05 14:13 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [ ] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

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

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

From c78c44c4056f5ede523e8776941e680c38ee12e8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/10] New package: llvm15-15.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 433 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 24 files changed, 1137 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 52a6d3e6d5fb..58c36a7bf2a7 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -991,6 +991,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
+libomp.so.5 libomp-15.0.6_1
+libomptarget.so.15 libomp-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..09952c5f4233
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,433 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES"
+	makedepends+=" libexecinfo-devel"
+	depends+=" libexecinfo-devel"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		x86_64-musl) # some sanitizer currently only on x86_64 stuff needs backtrace
+			vsed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+				${wrksrc}/compiler-rt/CMakeLists.txt
+			;;
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 64c69680cc8d9717e9e0af146dc6d19bd19c527d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/10] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 58c36a7bf2a7..d57773d41d08 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -986,9 +986,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 188a2b43323fee70fddc5190d58e9a75c742487c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/10] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 0b9296ded577b6f826e847e1c1818cf10259099f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/10] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 78361ec2b1ee091b3d34699d6086af909fd9dbce Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/10] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 168a67389bba..219ab9b50219 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.25.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From c60040bdbaa7b8b9101836c814afa798af61e6f2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/10] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 190cebb8e3bc..6c1b3386d358 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.15.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run
@@ -11,7 +11,7 @@ short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filte
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"
 homepage="https://github.com/iovisor/bpftrace/"
-distfiles="https://github.com/iovisor/bpftrace/archive/v${version}.tar.gz"
+distfiles="https://github.com/iovisor/bpftrace/archive/refs/tags/v${version}.tar.gz"
 checksum=64f67e615998d8150f5ee28614bea9ed303f20f6887bc4cdffa5f9c9477ef52a
 nostrip=yes  # needs to read own symbol table
 

From 7c2849d9bd34a615b51132d8371d06304b098259 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/10] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 4634152c07ff9a3239b41b14527afb7e97268b68 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/10] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 344403776bfe54b1e12f579d6b6daa3734165522 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/10] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From e2459d3b620336891f4d70a3a0931e74e029289e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/10] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (37 preceding siblings ...)
  2023-01-05 14:13 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-01-06 12:39 ` tranzystorek-io
  2023-01-06 12:56 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (55 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-06 12:39 UTC (permalink / raw)
  To: ml

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

New review comment by tranzystorek-io on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1063404490

Comment:
The submodules have been removed from llvm12, thanks!

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (38 preceding siblings ...)
  2023-01-06 12:39 ` [PR REVIEW] " tranzystorek-io
@ 2023-01-06 12:56 ` tranzystorek-io
  2023-01-06 16:15 ` tranzystorek-io
                   ` (54 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-06 12:56 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy
- [ ] beignet
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [ ] qt, qtcreator

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

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

From 63170afa46b67df47b4cc6d4dadcd54eb1661e24 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/10] New package: llvm15-15.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  38 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 428 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1170 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index f0917a476aa5..33c2dcdd3f43 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
+libomp.so.5 libomp-15.0.6_1
+libomptarget.so.15 libomp-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..7f89340b8bdf
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,38 @@
+gcc does not support using abi_tag in an extern "C" declaration
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+diff -rup libcxx/include/__support/musl/xlocale.h.orig libcxx/include/__support/musl/xlocale.h
+--- a/libcxx/include/__support/musl/xlocale.h.orig	2022-12-19 14:44:34.049044339 -0800
++++ b/libcxx/include/__support/musl/xlocale.h	2022-12-19 14:45:24.211247988 -0800
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..db510bbd2477
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,428 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From d853a3fdcc302937e10b48d237646e9dcc76ba3e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/10] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 33c2dcdd3f43..9d0dc1c25cff 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From d0eecab28039d4a54929aebeae7e53883851df56 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/10] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 6d69faefe1897edae9d93b3ab3d437d563f415b5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/10] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From fd691eb26f96f2cdbb110d8189ac6c4f43e7b434 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/10] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 168a67389bba..219ab9b50219 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.25.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From 9c18635faba0f34851ae42328b2385b09e744a7f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/10] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 190cebb8e3bc..6c1b3386d358 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.15.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run
@@ -11,7 +11,7 @@ short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filte
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"
 homepage="https://github.com/iovisor/bpftrace/"
-distfiles="https://github.com/iovisor/bpftrace/archive/v${version}.tar.gz"
+distfiles="https://github.com/iovisor/bpftrace/archive/refs/tags/v${version}.tar.gz"
 checksum=64f67e615998d8150f5ee28614bea9ed303f20f6887bc4cdffa5f9c9477ef52a
 nostrip=yes  # needs to read own symbol table
 

From f83c63f58dd37208b4efe5c5e6909233b2414685 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/10] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 0295fbeda543458631068bc0accf7802fad1e611 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/10] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 1486242530b7748f6d1e1599aad2eb1f08afd805 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/10] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 11d2d7c20a646304f57bcf24e4220f50db56b8d2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/10] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (39 preceding siblings ...)
  2023-01-06 12:56 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-01-06 16:15 ` tranzystorek-io
  2023-01-07 10:31 ` tranzystorek-io
                   ` (53 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-06 16:15 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy
- [ ] beignet
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [ ] qt, qtcreator
- [ ] bpftrace (https://github.com/void-linux/void-packages/pull/39002)

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

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

From 63170afa46b67df47b4cc6d4dadcd54eb1661e24 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/12] New package: llvm15-15.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  38 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 428 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1170 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index f0917a476aa5..33c2dcdd3f43 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
+libomp.so.5 libomp-15.0.6_1
+libomptarget.so.15 libomp-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..7f89340b8bdf
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,38 @@
+gcc does not support using abi_tag in an extern "C" declaration
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+diff -rup libcxx/include/__support/musl/xlocale.h.orig libcxx/include/__support/musl/xlocale.h
+--- a/libcxx/include/__support/musl/xlocale.h.orig	2022-12-19 14:44:34.049044339 -0800
++++ b/libcxx/include/__support/musl/xlocale.h	2022-12-19 14:45:24.211247988 -0800
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..db510bbd2477
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,428 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From d853a3fdcc302937e10b48d237646e9dcc76ba3e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/12] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 33c2dcdd3f43..9d0dc1c25cff 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From d0eecab28039d4a54929aebeae7e53883851df56 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/12] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 6d69faefe1897edae9d93b3ab3d437d563f415b5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/12] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From fd691eb26f96f2cdbb110d8189ac6c4f43e7b434 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/12] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 168a67389bba..219ab9b50219 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.25.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From 9c18635faba0f34851ae42328b2385b09e744a7f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/12] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 190cebb8e3bc..6c1b3386d358 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.15.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run
@@ -11,7 +11,7 @@ short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filte
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"
 homepage="https://github.com/iovisor/bpftrace/"
-distfiles="https://github.com/iovisor/bpftrace/archive/v${version}.tar.gz"
+distfiles="https://github.com/iovisor/bpftrace/archive/refs/tags/v${version}.tar.gz"
 checksum=64f67e615998d8150f5ee28614bea9ed303f20f6887bc4cdffa5f9c9477ef52a
 nostrip=yes  # needs to read own symbol table
 

From f83c63f58dd37208b4efe5c5e6909233b2414685 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/12] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 0295fbeda543458631068bc0accf7802fad1e611 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/12] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 1486242530b7748f6d1e1599aad2eb1f08afd805 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/12] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 11d2d7c20a646304f57bcf24e4220f50db56b8d2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/12] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From ec0520198a20203ec6754624439f31f56741cbaf Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/12] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 83bd90ce1259febe946c7aecc0195aa38145be4e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/12] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (40 preceding siblings ...)
  2023-01-06 16:15 ` tranzystorek-io
@ 2023-01-07 10:31 ` tranzystorek-io
  2023-01-07 17:02 ` tranzystorek-io
                   ` (52 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-07 10:31 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy
- [ ] beignet
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [ ] qt, qtcreator
- [ ] bpftrace (https://github.com/void-linux/void-packages/pull/39002)

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

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

From 63170afa46b67df47b4cc6d4dadcd54eb1661e24 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/13] New package: llvm15-15.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  38 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 428 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1170 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index f0917a476aa5..33c2dcdd3f43 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
+libomp.so.5 libomp-15.0.6_1
+libomptarget.so.15 libomp-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..7f89340b8bdf
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,38 @@
+gcc does not support using abi_tag in an extern "C" declaration
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+diff -rup libcxx/include/__support/musl/xlocale.h.orig libcxx/include/__support/musl/xlocale.h
+--- a/libcxx/include/__support/musl/xlocale.h.orig	2022-12-19 14:44:34.049044339 -0800
++++ b/libcxx/include/__support/musl/xlocale.h	2022-12-19 14:45:24.211247988 -0800
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..db510bbd2477
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,428 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From d853a3fdcc302937e10b48d237646e9dcc76ba3e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/13] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 33c2dcdd3f43..9d0dc1c25cff 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From d0eecab28039d4a54929aebeae7e53883851df56 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/13] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 6d69faefe1897edae9d93b3ab3d437d563f415b5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/13] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From fd691eb26f96f2cdbb110d8189ac6c4f43e7b434 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/13] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 168a67389bba..219ab9b50219 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.25.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From 9c18635faba0f34851ae42328b2385b09e744a7f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/13] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 190cebb8e3bc..6c1b3386d358 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.15.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run
@@ -11,7 +11,7 @@ short_desc="High-level tracing language for Linux enhanced Berkeley Packet Filte
 maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="Apache-2.0"
 homepage="https://github.com/iovisor/bpftrace/"
-distfiles="https://github.com/iovisor/bpftrace/archive/v${version}.tar.gz"
+distfiles="https://github.com/iovisor/bpftrace/archive/refs/tags/v${version}.tar.gz"
 checksum=64f67e615998d8150f5ee28614bea9ed303f20f6887bc4cdffa5f9c9477ef52a
 nostrip=yes  # needs to read own symbol table
 

From f83c63f58dd37208b4efe5c5e6909233b2414685 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/13] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 0295fbeda543458631068bc0accf7802fad1e611 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/13] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 1486242530b7748f6d1e1599aad2eb1f08afd805 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/13] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 11d2d7c20a646304f57bcf24e4220f50db56b8d2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/13] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From ec0520198a20203ec6754624439f31f56741cbaf Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/13] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 83bd90ce1259febe946c7aecc0195aa38145be4e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/13] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 93fe0f18ce51a1a5cc6309391a3f3fd4676579c3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/13] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (41 preceding siblings ...)
  2023-01-07 10:31 ` tranzystorek-io
@ 2023-01-07 17:02 ` tranzystorek-io
  2023-01-09  0:22 ` tranzystorek-io
                   ` (51 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-07 17:02 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy
- [ ] beignet
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] bpftrace (https://github.com/void-linux/void-packages/pull/39002)

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

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

From 7ded0344547be1d4cd30ba758a9d099d4c4135e2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/13] New package: llvm15-15.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  38 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 428 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1170 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 349c183cdb38..a1192ee99090 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
+libomp.so.5 libomp-15.0.6_1
+libomptarget.so.15 libomp-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..7f89340b8bdf
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,38 @@
+gcc does not support using abi_tag in an extern "C" declaration
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+diff -rup libcxx/include/__support/musl/xlocale.h.orig libcxx/include/__support/musl/xlocale.h
+--- a/libcxx/include/__support/musl/xlocale.h.orig	2022-12-19 14:44:34.049044339 -0800
++++ b/libcxx/include/__support/musl/xlocale.h	2022-12-19 14:45:24.211247988 -0800
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..db510bbd2477
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,428 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 574bcf44fafdddf85c813d35beb1be5935c5cd68 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/13] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index a1192ee99090..688992826987 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From fdc41093b8815d725ce4e4e9eb937340a60be5ec Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/13] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From ff6fdec4a2c5e520a2e539ed560e2903b06fc06f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/13] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From cbdd60209523392332623ae81db870c1f2ac0261 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/13] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 168a67389bba..219ab9b50219 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.25.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From a9eca990131612eb024808523e2bdc6a0cc6844e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/13] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From ef1ab0446d277380880c6302bb69cdf852fed053 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/13] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 7d4416ff7cdb52ba9ea76035751412313524a157 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/13] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From fc0eee247ef8617563805aa3bec656ffcb412117 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/13] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 2ef5161a7da0903f18a72031c6a6a11354e20be5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/13] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From e91e9e186b22b38390262ada6634db3b74d0515a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/13] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 5a83996d6b227860605c89f8a355d17e78ee5bfb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/13] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 47a4ccce3866dbcafa439891b1784e6be3eeb0b0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/13] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (42 preceding siblings ...)
  2023-01-07 17:02 ` tranzystorek-io
@ 2023-01-09  0:22 ` tranzystorek-io
  2023-01-09  0:58 ` tranzystorek-io
                   ` (50 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-09  0:22 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [ ] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

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

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

From 7ded0344547be1d4cd30ba758a9d099d4c4135e2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/14] New package: llvm15-15.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  38 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 428 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1170 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 349c183cdb38..a1192ee99090 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
+libomp.so.5 libomp-15.0.6_1
+libomptarget.so.15 libomp-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..7f89340b8bdf
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,38 @@
+gcc does not support using abi_tag in an extern "C" declaration
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+diff -rup libcxx/include/__support/musl/xlocale.h.orig libcxx/include/__support/musl/xlocale.h
+--- a/libcxx/include/__support/musl/xlocale.h.orig	2022-12-19 14:44:34.049044339 -0800
++++ b/libcxx/include/__support/musl/xlocale.h	2022-12-19 14:45:24.211247988 -0800
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..db510bbd2477
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,428 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 574bcf44fafdddf85c813d35beb1be5935c5cd68 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/14] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index a1192ee99090..688992826987 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From fdc41093b8815d725ce4e4e9eb937340a60be5ec Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/14] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From ff6fdec4a2c5e520a2e539ed560e2903b06fc06f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/14] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From cbdd60209523392332623ae81db870c1f2ac0261 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/14] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 168a67389bba..219ab9b50219 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.25.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From a9eca990131612eb024808523e2bdc6a0cc6844e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/14] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From ef1ab0446d277380880c6302bb69cdf852fed053 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/14] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 7d4416ff7cdb52ba9ea76035751412313524a157 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/14] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From fc0eee247ef8617563805aa3bec656ffcb412117 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/14] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 2ef5161a7da0903f18a72031c6a6a11354e20be5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/14] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From e91e9e186b22b38390262ada6634db3b74d0515a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/14] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 5a83996d6b227860605c89f8a355d17e78ee5bfb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/14] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 47a4ccce3866dbcafa439891b1784e6be3eeb0b0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/14] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 2087ff2b1d6ed5e0261651fd802b818cc9242c31 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/14] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (43 preceding siblings ...)
  2023-01-09  0:22 ` tranzystorek-io
@ 2023-01-09  0:58 ` tranzystorek-io
  2023-01-10  8:20 ` dkwo
                   ` (49 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-09  0:58 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [ ] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

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

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

From 7ded0344547be1d4cd30ba758a9d099d4c4135e2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/15] New package: llvm15-15.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  38 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 428 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1170 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 349c183cdb38..a1192ee99090 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
+libomp.so.5 libomp-15.0.6_1
+libomptarget.so.15 libomp-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..7f89340b8bdf
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,38 @@
+gcc does not support using abi_tag in an extern "C" declaration
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+diff -rup libcxx/include/__support/musl/xlocale.h.orig libcxx/include/__support/musl/xlocale.h
+--- a/libcxx/include/__support/musl/xlocale.h.orig	2022-12-19 14:44:34.049044339 -0800
++++ b/libcxx/include/__support/musl/xlocale.h	2022-12-19 14:45:24.211247988 -0800
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..db510bbd2477
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,428 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 574bcf44fafdddf85c813d35beb1be5935c5cd68 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/15] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index a1192ee99090..688992826987 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From fdc41093b8815d725ce4e4e9eb937340a60be5ec Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/15] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From ff6fdec4a2c5e520a2e539ed560e2903b06fc06f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/15] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From cbdd60209523392332623ae81db870c1f2ac0261 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/15] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 168a67389bba..219ab9b50219 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.25.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From a9eca990131612eb024808523e2bdc6a0cc6844e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/15] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From ef1ab0446d277380880c6302bb69cdf852fed053 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/15] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 7d4416ff7cdb52ba9ea76035751412313524a157 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/15] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From fc0eee247ef8617563805aa3bec656ffcb412117 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/15] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 2ef5161a7da0903f18a72031c6a6a11354e20be5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/15] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From e91e9e186b22b38390262ada6634db3b74d0515a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/15] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 5a83996d6b227860605c89f8a355d17e78ee5bfb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/15] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 47a4ccce3866dbcafa439891b1784e6be3eeb0b0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/15] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 2087ff2b1d6ed5e0261651fd802b818cc9242c31 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/15] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 75587f2cae64f469156b0611bc7e3dc928b552c2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/15] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index f6798d37a778..fbda8ff4bbba 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.08.3
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (44 preceding siblings ...)
  2023-01-09  0:58 ` tranzystorek-io
@ 2023-01-10  8:20 ` dkwo
  2023-01-12 18:46 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (48 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: dkwo @ 2023-01-10  8:20 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1376888359

Comment:
Perhaps it's better to also update river and waylock.
I've been using them with static zig for a while, with no issues. Just for reference:
```
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.2
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie -Dstrip"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel pixman-devel
+ wayland-protocols"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=99c256c6b1461d9beeff95fae0db54403e2b12f96e4c959ddbcaeae73fd89091

 build_options="xwayland"
 build_options_default="xwayland"
```
with no patch, as well as
```
 # Template file for 'waylock'
 pkgname=waylock
-version=0.3.5
+version=0.6.1
 revision=1
-build_style=cargo
+build_style=zig-build
+configure_args="-Dpie -Dstrip -Drelease-safe"
 hostmakedepends="pkg-config"
-makedepends="libxkbcommon-devel pam-devel"
+makedepends="libxkbcommon-devel pam-devel wayland-protocols wayland-devel scdoc"
 short_desc="Simple screenlocker for wayland compositors"
 maintainer="Isaac Freund <ifreund@ifreund.xyz>"
-license="MIT"
+license="ISC"
 homepage="https://github.com/ifreund/waylock"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=60abf78ae8aa9c28f3230f157607fbd74250a51322776ad1b7abed1408432b87
+distfiles="https://github.com/ifreund/waylock/releases/download/v${version}/waylock-${version}.tar.gz"
+checksum=4d3fc46b0f48c964362fdfceff27314a87b28cb3c40fbf782d24ca755bfa8c55
 
 post_install() {
        vlicense LICENSE
```

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (45 preceding siblings ...)
  2023-01-10  8:20 ` dkwo
@ 2023-01-12 18:46 ` tranzystorek-io
  2023-01-14 22:16 ` Johnnynator
                   ` (47 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-12 18:46 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

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

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

From bcc53ccf7d47444dc139885973aa38d59cb616b3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/15] New package: llvm15-15.0.6

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  38 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 428 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1170 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 0a803960ab55..183accaeb0de 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.6_1
+libomp.so.5 libomp-15.0.6_1
+libomptarget.so.15 libomp-15.0.6_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..7f89340b8bdf
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,38 @@
+gcc does not support using abi_tag in an extern "C" declaration
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+diff -rup libcxx/include/__support/musl/xlocale.h.orig libcxx/include/__support/musl/xlocale.h
+--- a/libcxx/include/__support/musl/xlocale.h.orig	2022-12-19 14:44:34.049044339 -0800
++++ b/libcxx/include/__support/musl/xlocale.h	2022-12-19 14:45:24.211247988 -0800
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..db510bbd2477
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,428 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.6
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=9d53ad04dc60cb7b30e810faf64c5ab8157dadef46c8766f67f286238256ff92
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove usr/bin/ld.lld*
+		vmove usr/bin/ld64.lld*
+		vmove usr/bin/lld*
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove usr/bin/*lldb*
+		vmove usr/lib/liblldb*so.*
+		vmove /usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
+		vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From f1286fd92d7bba0f37e949aba7e3ed26dea10ade Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/15] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 183accaeb0de..bdffeeccb7e5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.6_1
+libclang.so.15 libclang-15.0.6_1
+libclang-cpp.so.15 libclang-cpp-15.0.6_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.6_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 9fe1587bf62e6db60a3fba476084c0c0031a9407 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/15] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From f818cd4aba5f9a15b5771970a4616b04bb618e8c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/15] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From f7822739638617e4f8f083b9210dd235c6c9a4b3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/15] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 168a67389bba..219ab9b50219 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.25.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From 481a44ee8c0b45edc421b03c04180a1aebba2707 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/15] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From 06424f978e20ecf819e6f04086cb4436335a4b87 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/15] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From b0b13f5eb3fad154bb113b68ff94464718628d37 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/15] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 3fc8129ad95fdf1bd61231161ee7d28a45297da0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/15] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From cd20f2aba0278bddd9838916739fe2ca93d2b53d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/15] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 885e7b46ea5f7a8d64e5312679be9289f2ab142b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/15] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 63cae3d4b8504ac5092e421f5d08e5052dbf2621 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/15] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 9ce79731829d089209296764cd7bc6d231b78e2e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/15] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 5e53a1e7a2333e5775c57f95d5e444174ce9c5d6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/15] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 3ca52dc9a045612a4cafb7d0571c0eec2fc902bc Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/15] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (46 preceding siblings ...)
  2023-01-12 18:46 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-01-14 22:16 ` Johnnynator
  2023-01-15  1:46 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (46 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: Johnnynator @ 2023-01-14 22:16 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1382939956

Comment:
I did some fixes for cross, also I don't think we need the per target runtime dirs, and if we did use them you should probably use a wildcard in vinstall

```diff
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
index db510bbd24..6249ec307c 100644
--- a/srcpkgs/llvm15/template
+++ b/srcpkgs/llvm15/template
@@ -4,6 +4,7 @@ version=15.0.6
 revision=1
 build_wrksrc=llvm
 build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
 configure_args="
  -DCMAKE_BUILD_TYPE=Release -Wno-dev
  -DENABLE_LINKER_BUILD_ID=YES
@@ -23,11 +24,15 @@ configure_args="
  -DLLVM_LINK_LLVM_DYLIB=YES
  -DLLVM_ENABLE_RTTI=YES
  -DLLVM_ENABLE_FFI=YES
- -DLLVM_BINUTILS_INCDIR=/usr/include"
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
 hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
  python3-recommonmark python3-sphinx-automodapi"
 makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
  libxml2-devel binutils-devel libatomic-devel"
 depends="libllvm15>=${version}_${revision}"
 short_desc="Low Level Virtual Machine"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -56,7 +61,7 @@ _libomp_enable=no
 
 case "$XBPS_TARGET_MACHINE" in
        ppc64le*) ;;
-       ppc*|i686*) _lldb_enable=no ;;
+       ppc*|i686*|riscv64*) _lldb_enable=no ;;
 esac
 
 case "$XBPS_TARGET_MACHINE" in
@@ -153,9 +158,14 @@ pre_configure() {
                        -DLLVM_ENABLE_PROJECTS=${_enabled_projects}
                make ${makejobs} -C utils/TableGen
                make ${makejobs} -C tools/clang/utils/TableGen
+               make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+               make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
                [ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
                configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
                configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+               configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+               configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+               [ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
                [ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
                cd ../..
        fi
@@ -298,9 +308,9 @@ lld_package() {
        short_desc+=" - linker"
        homepage="https://lld.llvm.org"
        pkg_install() {
-               vmove usr/bin/ld.lld*
-               vmove usr/bin/ld64.lld*
-               vmove usr/bin/lld*
+               vmove "usr/bin/ld.lld*"
+               vmove "usr/bin/ld64.lld*"
+               vmove "usr/bin/lld*"
                vmove usr/bin/wasm-ld
                vmove usr/share/doc/LLVM/lld
        }
@@ -324,9 +334,9 @@ lldb_package() {
        short_desc+=" - LLDB debugger"
        homepage="https://lldb.llvm.org/"
        pkg_install() {
-               vmove usr/bin/*lldb*
-               vmove usr/lib/liblldb*so.*
-               vmove /usr/lib/python*
+               vmove "usr/bin/*lldb*"
+               vmove "usr/lib/liblldb*so.*"
+               vmove usr/lib/python*
        }
 }
 
@@ -343,7 +353,7 @@ lldb-devel_package() {
 llvm-libunwind_package() {
        short_desc+=" - libunwind"
        pkg_install() {
-               vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so.*"
+               vmove "usr/lib/libunwind.so.*"
        }
 }
 
@@ -354,8 +364,8 @@ llvm-libunwind-devel_package() {
        pkg_install() {
                vmove usr/include/mach-o
                vmove "usr/include/*unwind*"
-               vmove "usr/lib/${XBPS_TRIPLET}/libunwind.a"
-               vmove "usr/lib/${XBPS_TRIPLET}/libunwind.so"
+               vmove "usr/lib/libunwind.a"
+               vmove "usr/lib/libunwind.so"
                vmove usr/share/doc/LLVM/libunwind
        }
 }
@@ -363,7 +373,7 @@ llvm-libunwind-devel_package() {
 libcxxabi_package() {
        short_desc+=" - low level support for libc++"
        pkg_install() {
-               vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so.*"
+               vmove "usr/lib/libc++abi.so.*"
        }
 }
 
@@ -372,15 +382,15 @@ libcxxabi-devel_package() {
        depends="libcxxabi>=${version}_${revision}"
        pkg_install() {
                vmove "usr/include/*cxxabi*"
-               vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.so"
-               vmove "usr/lib/${XBPS_TRIPLET}/libc++abi.a"
+               vmove "usr/lib/libc++abi.so"
+               vmove "usr/lib/libc++abi.a"
        }
 }
 
 libcxx_package() {
        short_desc+=" - C++ standard library"
        pkg_install() {
-               vmove "usr/lib/${XBPS_TRIPLET}/libc++.so.*"
+               vmove "usr/lib/libc++.so.*"
        }
 }
 
@@ -389,9 +399,9 @@ libcxx-devel_package() {
        depends="libcxx>=${version}_${revision}"
        pkg_install() {
                vmove usr/include/c++
-               vmove "usr/lib/${XBPS_TRIPLET}/libc++.so"
-               vmove "usr/lib/${XBPS_TRIPLET}/libc++.a"
-               vmove "usr/lib/${XBPS_TRIPLET}/libc++experimental.a"
+               vmove "usr/lib/libc++.so"
+               vmove "usr/lib/libc++.a"
+               vmove "usr/lib/libc++experimental.a"
                vmove usr/share/doc/LLVM/libcxx
        }
 }
```


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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (47 preceding siblings ...)
  2023-01-14 22:16 ` Johnnynator
@ 2023-01-15  1:46 ` tranzystorek-io
  2023-01-16 13:45 ` tranzystorek-io
                   ` (45 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-15  1:46 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [ ] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

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

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

From 69f13dec827455a5424e9b90f442346314d4609b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/15] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 437 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1178 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 0a803960ab55..01818dec25db 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..ad83172de569
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,437 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 426a6e25deb9c9eb75a6a314f48dc56eb518f452 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/15] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 01818dec25db..142d64240be2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From dbb6384222a2a6c8d570db5c502ecac235f1120d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/15] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From b564d8935d98541bd21ff6f42c77ece159a491d8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/15] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 3e7d62ff1a228644f3a700015afdeda5970af1c1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/15] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 8e9c453c38c6..9dfcc7188bdc 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From 15d9e20a3917cdc031619df353271081e27b3764 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/15] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From dba4d1c608c8bd4b9aea3f10607f4e420aaf372a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/15] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From afe9e29644268cb76ef3707b25de08c8d876cce4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/15] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From dee863d929eeb15f501577090a0457986d1f6a9a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/15] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 65208d4567104746aea6984de11597484de3e207 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/15] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 45e6a1934830c750e17cdfaa12e7d66bf01931b2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/15] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 047510489cea90f6b73eee9d3e77f3cf5daad705 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/15] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 2fe00219614e3d7e6b6f6cd5f7b457b5a859837a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/15] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 4d3debd1f7f79a7ba3e1bc22dd10e9f73fb2e005 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/15] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 3607a73fb0d38e4d470706ecb4af8f3dcaaede31 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/15] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (48 preceding siblings ...)
  2023-01-15  1:46 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-01-16 13:45 ` tranzystorek-io
  2023-01-17 19:01 ` [PR REVIEW] " Johnnynator
                   ` (44 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-16 13:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<=14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

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

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

From ea55ec842f4a6624957d72d2a9a3c401cc462870 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/16] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 437 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1178 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 0a803960ab55..01818dec25db 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..ad83172de569
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,437 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 5d10d57cbd5c6b388e8b5e6320b6ccb95dfed83d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/16] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 01818dec25db..142d64240be2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From afdddb391dedcf7c362fd19e91006b71af948a56 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/16] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From dbfdbb279fec91c40ca0c339d313bb0d02dc2d5f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/16] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From eaaa93ff0beeda17cc374a8e8d77f501f6987119 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/16] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 8e9c453c38c6..9dfcc7188bdc 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From d79984fe7e774f15dc7a74e77b7e2e999c4d275b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/16] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From cd66cba2d0a0aedec550d5ebbb27d87700c4e287 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/16] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 1d8e862bd5ebb31d3e55e8a6dac363286c3f7d4a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/16] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 8f80815daed4018895639d56ce5d5b25fc6d8eea Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/16] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 92021ca16c5225518336305b810a815fe03f6217 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/16] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 857021759682f0b35e3472f17d9b7a722c7f4e92 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/16] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 10c8c433a1ff386058d5c3559d369fa2670daa5d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/16] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 283dfd5789ae8e7c9381d8e7a26a041e958c2ca3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/16] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From cf30b6c35b0ff2db9c199fed1cec81812c402e21 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/16] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From a15510ee83435bcf7a1331697dc56016aced284a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/16] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 3252e804d36f601551561e1cddd350c5aef156a4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/16] zig: update to 0.10.0

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..be28175b5c44 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.0
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=d8409f7aafc624770dcd050c8fa7e62578be8e6a10956bca3c86e8531c64c136
 nopie=yes
 nocross=yes
 

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

* Re: [PR REVIEW] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (49 preceding siblings ...)
  2023-01-16 13:45 ` tranzystorek-io
@ 2023-01-17 19:01 ` Johnnynator
  2023-01-24 13:05 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (43 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: Johnnynator @ 2023-01-17 19:01 UTC (permalink / raw)
  To: ml

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

New review comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#discussion_r1072679655

Comment:
```suggestion
		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
```

It seems like confusable chars did get confused slightly.

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (50 preceding siblings ...)
  2023-01-17 19:01 ` [PR REVIEW] " Johnnynator
@ 2023-01-24 13:05 ` tranzystorek-io
  2023-01-24 13:15 ` tranzystorek-io
                   ` (42 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-24 13:05 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

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

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

From 2b3c100198a349d6c5ac5ae3d898ddf41b72b92c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/17] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 437 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1178 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 32b6337a4f92..6b2e3b50ba5a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..92dadb185a7a
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,437 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 04b227473fb61239a1c3edb6dad27cb8d73fee4b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/17] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 6b2e3b50ba5a..07ff0092d033 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 603944bf2336d240897b602cce763696776b2992 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/17] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From bb6130b7dc2d4b967b2ae5a86b75ace1af24e4f3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/17] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 586aa7eff54f3a557544e4e810ae0797018a1940 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/17] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 8e9c453c38c6..9dfcc7188bdc 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3"

From dc8b644516ceca0a42ee1146815909ca10c453ed Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/17] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From a50ff4c40fd129a99c0698c576e5cb968a175083 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/17] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From daa4f322bbfe7d581fdacf9a75008d13d4a1e6b7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/17] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From dc550a62c7e63d8673587f72d8709a96c0c15d54 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/17] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From ab0cc34a087efceae80fdb9653c1acfaf9a12277 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/17] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 9d1f87fe1f291561b587c0bd60c47d14a0806acd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/17] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 80ff7078242f91db4c8dd8627e55d5194a54f393 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/17] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 822fffb47abfe05aeafe907bc09db122c13d5fb0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/17] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 6fbd421ebbea92fa0ecb09708ea9a5c407699eb4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/17] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 9cc4dc7a13b82e73a2426a207fde6ba4573dcea6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/17] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 4336ace614ac0d9e1455e63a4bc4790c35555aac Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/17] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 0d158423f5613fa2364468ecff5faddb508cab9e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/17] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (51 preceding siblings ...)
  2023-01-24 13:05 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-01-24 13:15 ` tranzystorek-io
  2023-01-26 22:36 ` tranzystorek-io
                   ` (41 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-24 13:15 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

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

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

From 586b282e6901c378a775379309a20bb6a64e26ee Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/17] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 437 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1178 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 6c5548c50ef7..5c7362d47b0e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..92dadb185a7a
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,437 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From c61d2ed47e630097b6dc6d1ed5d7e291b943f63b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/17] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 5c7362d47b0e..f62083061911 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From b3047c776e65003a203f48cdd6a7c459eae2a730 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/17] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 46c383c0d00cbfd89d99c12f37104639c82b8b73 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/17] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 6483d7eb153d7fc23e70a860af2efbb2f6dcd3d5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/17] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 6dcf874e912447b3c034e6d15102bb736378e1de Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/17] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From 90ce7ee74b51de8cae6e08530633545713955fae Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/17] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 7bbc3c0dc99e7df4804fc41f7680018b7e663518 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/17] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From f6ed2bad4d7e3d3058ccae790f245602ee02746e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/17] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 6c34d9bc99d526de30174235c4e639467ef7755b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/17] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 63c1fc686ecd5cb698c00aa4de7a166f5c703613 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/17] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 9bdb5c4aafb7e63d781806c6c00099054926437b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/17] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 5825f11fbff7ecee5cedae79f1dfd781202505d3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/17] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index 233596587525..bc9170215483 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -3,7 +3,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From d6dbb936e1bda0d359501b2ec817f6eda1bc90dd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/17] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 882017504c3adb0d2212d1c39588a6bdf2b65210 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/17] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 82d2c536d3bae552d5998ac0f8723b8d175da440 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/17] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 3157fd6e358dc3cb8d610cea45050a93ae6c80e4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/17] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (52 preceding siblings ...)
  2023-01-24 13:15 ` tranzystorek-io
@ 2023-01-26 22:36 ` tranzystorek-io
  2023-02-01 12:34 ` tranzystorek-io
                   ` (40 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-01-26 22:36 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)
- [x] zig

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

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

From bbe7cf961fd8f108538f804c4530f2db18bf1221 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/17] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 437 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1178 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index f632ce9c76da..da2aa877c210 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..92dadb185a7a
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,437 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 7853d525c75847c4ab2d85f9ef664df3360a985d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/17] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index da2aa877c210..5daf973dab55 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 8c6685104cbb075102d2c98edc7b151d644ef099 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/17] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 7060f61e5f0053f2ff34faab9a56588fcb708980 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/17] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 8f6d72a1f00df718496c9f01153c33e4bfc4c638 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/17] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 2b2d4892c68a5340bfc8dceb69691349b771464f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/17] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From 3ca686046113a34305de995cfef7e79c84ba16f7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/17] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 5123fb69d4643183c26e6f7261434cc857de43c4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/17] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From dc52939b29e63252cd754d781ba9c0dc16f4da72 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/17] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 7b4af1f616fb98e350a77b99a50ccade2316e6e0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/17] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 672ee4e00095d92c002acde8916f79d54501d6fe Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/17] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 926f5109bfad09431b997c6c9e6e7f20aecaa3e2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/17] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 87e033681534ee79b114e841cecde160818f205b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/17] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 2b22458c46987b97325f2e2ce687908347c4ebed Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/17] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 7138a44b31f959b422fd2991c6cd93e7c2e176a2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/17] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 9821e34581b5d5f772fd2898a2ef95468eeace25 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/17] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 0a157d4283e7ed4e80e61d4b91ce0ac5ea2bd2d4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/17] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (53 preceding siblings ...)
  2023-01-26 22:36 ` tranzystorek-io
@ 2023-02-01 12:34 ` tranzystorek-io
  2023-02-05 12:42 ` tranzystorek-io
                   ` (39 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-01 12:34 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)
- [x] zig

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

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

From 1abddb63e32526890c55b2609f783bae584d02f5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/17] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 437 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1178 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 523fd15af734..fb406ba6a045 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..92dadb185a7a
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,437 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 20d634420c95f79cab4217a0a162c1794591ec23 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/17] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index fb406ba6a045..cebbd1a43219 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From e22a5a8af503b20993556021f59e3277d100aa6d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/17] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 92b45af858c36222c22354a6e9c022f2c417073e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/17] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 30cc2090b4665b5cd519e97acf22b7a979dbb007 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/17] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 8c529f0865535d61b180c7d3f0c38a5a0be9188f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/17] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From 58444aa5b7ab5e8a1a5790291dc21eee3dd70bcb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/17] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 6b2ea678f0d595d7b9a43401dcf5497484cb1ad3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/17] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From dce97e235b640ac80e5e8f8a66ec6d3fe8c5b832 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/17] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 06329bff205736f7a7b4667d86fdd04c205348e5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/17] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 91523bf89d8290542ea7779666f29d75b86bd2cc Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/17] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 4b3691ab43fe3fe119aa15bcb995d98cac04fc65 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/17] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 8c337a5d7cc88c6663bfa8d27064cac0f1485e8e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/17] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 5bdc742ad0ac7955ea11737d8b3426d317c5ae4c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/17] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 2dbcd466df2add2c0798bd71507756e20386d132 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/17] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 6ce54fd1663ec08d903369197a86734c1d8ed5f8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/17] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From d46036e94c85b3ea2bbf0b3b8eef8eff2f4eb164 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/17] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (54 preceding siblings ...)
  2023-02-01 12:34 ` tranzystorek-io
@ 2023-02-05 12:42 ` tranzystorek-io
  2023-02-05 13:58 ` tranzystorek-io
                   ` (38 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-05 12:42 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)
- [x] zig

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

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

From 7a05008bd06bf04902c0c7d281e318439a4b6015 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/17] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 110 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 437 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1178 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 59444164928b..837a476da03f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..25688d40dbc2
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,110 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,87 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..92dadb185a7a
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,437 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 29f2ced0a3f305243e3e797c0eda87c0cd8f0aa9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/17] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 837a476da03f..39870a6cbe5b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 7a6608ac84a3f6737b0a034f759935ed6d37788a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/17] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 22041e1f60b1bbe81393e41a848358981871fe41 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/17] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From d2724177cf21cc2dbd0596297b62861bb5971aaa Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/17] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From b26023d1142be10fac4721b1e49bc7e872e36ae9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/17] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From 854cd00a2956948f8dd719b3921103e455f2efb6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/17] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 0ad3b237b3f85fc89dc33aae58f541fb33b65d16 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/17] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 6a293d6aced172d7e1cd35fc1699e55c698059ee Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/17] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 750f2c64b5a380cc32457900ea6115bf4fe3772a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/17] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From c85a9c0ef7471b8a60aa0acad4d4f27c93a6cf96 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/17] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From b4a72e0b01e73cd28cd2cc6a047723552a7ef78c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/17] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 8239f1f4a0925cfcfc0891798edbb722755d693a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/17] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 01b48d2f05efde1727f513db94d7052eb82d6022 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/17] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b768b332b053c4686f83c6b3c946a053b8434b06 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/17] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 736b6562a14df9f93bc58806f54d3e51cea0916a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/17] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 144d508d5254bd72db0c5be3aefed6ab6d6c704b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/17] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (55 preceding siblings ...)
  2023-02-05 12:42 ` tranzystorek-io
@ 2023-02-05 13:58 ` tranzystorek-io
  2023-02-07  9:14 ` tranzystorek-io
                   ` (37 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-05 13:58 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)
- [x] zig

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

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

From 83ed893c860f3dbb493b8aaa6ed56eace35a182a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/17] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1188 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 59444164928b..837a476da03f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From e284fa2440997fc7a719f67726f9972ac2b1d5a9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/17] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 837a476da03f..39870a6cbe5b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 65c7ac23131bca8df2412f84e5f8c2cce004e069 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/17] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From a64abdf63407e50fde12455c69ba2488f906421a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/17] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 6403589341ea809115ebbc08bffb7477598e784d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/17] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From b3b783d37f35cff147cb1d39ead9550d0982aae8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/17] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From a913a78f621ec3da9c96f833c2cddc670d51b859 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/17] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 6417660149cad6a90005bd7675aea28e8ed1ea7f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/17] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From f1d5603b42bace59914668483b033f4436c42143 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/17] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 7b8e95960e6ac97c97d8fac34f299c7d1c7b2f7b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/17] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 0b5073f0ad80bf84255ce7531ee7379aa79fc810 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/17] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 50defe68a2b5d990ed363a7197e1f4f2c3599906 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/17] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 5e4d02c538817a5ad985059a1deca48cf65d290e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/17] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 167dc9bc34e9422eb98ed7228b31e8206bf760fb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/17] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b8593281df85fc43260318bfeb429859b001f54f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/17] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 688a0dde7b176013a2422ca97f851931d1ff7203 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/17] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From cbfd79b2f183eeaaf87269bdcb6f336ffeb06936 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/17] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (56 preceding siblings ...)
  2023-02-05 13:58 ` tranzystorek-io
@ 2023-02-07  9:14 ` tranzystorek-io
  2023-02-10 14:20 ` tranzystorek-io
                   ` (36 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-07  9:14 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)
- [x] zig

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

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

From fe708476a4f1bb670a669030b58794250a0a58a2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/17] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1188 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 504d29f4cb98..7c1c48c61065 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From b81398a9183fc5b6749ac0aeb58a44783527a258 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/17] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7c1c48c61065..44059d647598 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 34d4df6ce2bc5330a78442bb2f0021614595f97a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/17] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 880e264c233cda747a9917c5cbf2678d89359632 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/17] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 357225b9a24dc884a9ac3ab2db1c647230cda13e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/17] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From a41d1cb64d4100cc1a2c6758b2ad71eb5e263095 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/17] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 857815d29eef..47f2b5e77024 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.16.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"  # needs root to run

From f8a8e657bf3909ecde8d8de0cdcbaa8d0c86ce66 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/17] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 396d37c9bd91a5fe907666a7919bcd51228913af Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/17] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 254bb0b014ed7b4680460b90b6a333fd2387808d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/17] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 52fe4cfeb5ba960f3862f21365c3d06db7bd957b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/17] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From b36190b13690c53467460558f3682365e177ec72 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/17] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 23cfbfe59ae4f227a5ed4a331b6b5674be26e8a1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/17] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 98e49b931d6eceba0fd02f1dccedd018a3f39c5b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/17] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From fa7cfdd6ee61f602031d23dfc1bfbffad5d4f87e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/17] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 5f9ea31f680ccd431088b2562ad08dde2265e0ea Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/17] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 34d7c81e1cfc10e4d106ca997b8b25dc9f284e5a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/17] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From d7e40e38e90b7f69c1a2820063e74f834e109146 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/17] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (57 preceding siblings ...)
  2023-02-07  9:14 ` tranzystorek-io
@ 2023-02-10 14:20 ` tranzystorek-io
  2023-02-10 14:49 ` oreo639
                   ` (35 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-10 14:20 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)
- [x] zig

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

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

From fb0c52ffe973a6110b9bf45c87af5b24386fb919 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/17] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1188 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 504d29f4cb98..7c1c48c61065 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 016ed775e5f482f98a2ede7a10bc24b0069eb0e0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/17] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7c1c48c61065..44059d647598 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 6ffb3cba2fc9858ba7d8c4134f5c717ffa7fb9bd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/17] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From f107c174d7db3ec041d33f29d3ace0e0ca7a3643 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/17] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 2c014990d7cabd857e083e0ac251d5a1a2c44497 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/17] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From ad39f276bbf08e7f46e82254e5dfe05e0eac66ca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/17] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From dab4452e67bcaeab84a0dd9b57e42c2794939d96 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/17] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 6575511ac94de71e86bee37bbe1eb9ac035b34bb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/17] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From cfb10130dbbe37aa8eaf3ebbcb6c8ba830eea236 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/17] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From a227b2c3d4d2d874b07df6b09de77824c37093f1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/17] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 74116ebc192456de70491ac34c64b0222efde682 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/17] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From b6b4447de6417801abb7ddb9a4c148c7328d9639 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/17] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From dc093beccdff4269e28883f1e1ac6044af192586 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/17] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 9124558c136377ee1417486e7ba3b351d5321eb6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/17] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b79afad74cea41a0637fd8529ea72b64e2c22e32 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/17] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 7c3e77332a91c1c6edee94f525cba001196c9131 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/17] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 9f7e9b679d0fc46301afe5472f2cd9f0627d83ef Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/17] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (58 preceding siblings ...)
  2023-02-10 14:20 ` tranzystorek-io
@ 2023-02-10 14:49 ` oreo639
  2023-02-10 14:50 ` oreo639
                   ` (34 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2023-02-10 14:49 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1425912418

Comment:
The libclc tests fail on every distro afaict (at least on Debian, Fedora, and Alpine) LLVM upstream's CI compiles with everything enabled except clspv and doesn't run those tests.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (59 preceding siblings ...)
  2023-02-10 14:49 ` oreo639
@ 2023-02-10 14:50 ` oreo639
  2023-02-10 14:51 ` oreo639
                   ` (33 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2023-02-10 14:50 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1425912418

Comment:
> libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

The libclc tests fail on every distro afaict (at least on Fedora and Alpine) LLVM upstream's CI compiles with everything enabled except clspv and doesn't run those tests.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (60 preceding siblings ...)
  2023-02-10 14:50 ` oreo639
@ 2023-02-10 14:51 ` oreo639
  2023-02-10 14:51 ` oreo639
                   ` (32 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2023-02-10 14:51 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1425912418

Comment:
> libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

The clspv libclc tests fail on every distro afaict (at least on Fedora and Alpine) LLVM upstream's CI compiles with everything enabled except clspv and doesn't run those tests. We don't ship clspv so it should be fine to just not enable it.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (61 preceding siblings ...)
  2023-02-10 14:51 ` oreo639
@ 2023-02-10 14:51 ` oreo639
  2023-02-10 14:55 ` oreo639
                   ` (31 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2023-02-10 14:51 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1425912418

Comment:
> libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

The clspv libclc tests fail on every distro afaict (at least on Fedora and Alpine) LLVM upstream's CI compiles with everything enabled except clspv and doesn't run those tests. We don't ship clspv so it should be fine to just disable it.

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (62 preceding siblings ...)
  2023-02-10 14:51 ` oreo639
@ 2023-02-10 14:55 ` oreo639
  2023-02-10 16:26 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (30 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2023-02-10 14:55 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1425912418

Comment:
> libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)

The clspv libclc tests fail on every distro afaict (at least on Fedora and Alpine) LLVM upstream's CI compiles with everything enabled except clspv and doesn't run those tests. We don't ship clspv so it should be fine to just disable it.

https://src.fedoraproject.org/rpms/libclc/blob/rawhide/f/libclc.spec#_83
https://github.com/alpinelinux/aports/blob/master/testing/libclc/APKBUILD#L25
https://github.com/llvm/llvm-project/blob/main/.github/workflows/llvm-project-tests.yml#L93

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (63 preceding siblings ...)
  2023-02-10 14:55 ` oreo639
@ 2023-02-10 16:26 ` tranzystorek-io
  2023-02-10 16:42 ` tranzystorek-io
                   ` (29 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-10 16:26 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [ ] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log)
- [x] zig

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

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

From fb0c52ffe973a6110b9bf45c87af5b24386fb919 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/18] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1188 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 504d29f4cb98..7c1c48c61065 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 016ed775e5f482f98a2ede7a10bc24b0069eb0e0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/18] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7c1c48c61065..44059d647598 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 6ffb3cba2fc9858ba7d8c4134f5c717ffa7fb9bd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/18] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From f107c174d7db3ec041d33f29d3ace0e0ca7a3643 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/18] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 2c014990d7cabd857e083e0ac251d5a1a2c44497 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/18] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From ad39f276bbf08e7f46e82254e5dfe05e0eac66ca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/18] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From dab4452e67bcaeab84a0dd9b57e42c2794939d96 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/18] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 6575511ac94de71e86bee37bbe1eb9ac035b34bb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/18] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From cfb10130dbbe37aa8eaf3ebbcb6c8ba830eea236 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/18] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From a227b2c3d4d2d874b07df6b09de77824c37093f1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/18] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 74116ebc192456de70491ac34c64b0222efde682 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/18] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From b6b4447de6417801abb7ddb9a4c148c7328d9639 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/18] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From dc093beccdff4269e28883f1e1ac6044af192586 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/18] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 9124558c136377ee1417486e7ba3b351d5321eb6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/18] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b79afad74cea41a0637fd8529ea72b64e2c22e32 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/18] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 7c3e77332a91c1c6edee94f525cba001196c9131 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/18] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 9f7e9b679d0fc46301afe5472f2cd9f0627d83ef Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/18] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From cd6bb59d0104d7671658a9f6f5e240e30f033cef Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/18] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..1ec7dfef383a 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (64 preceding siblings ...)
  2023-02-10 16:26 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-02-10 16:42 ` tranzystorek-io
  2023-02-10 19:21 ` tranzystorek-io
                   ` (28 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-10 16:42 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From fb0c52ffe973a6110b9bf45c87af5b24386fb919 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/18] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1188 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 504d29f4cb98..7c1c48c61065 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 016ed775e5f482f98a2ede7a10bc24b0069eb0e0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/18] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7c1c48c61065..44059d647598 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 6ffb3cba2fc9858ba7d8c4134f5c717ffa7fb9bd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/18] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From f107c174d7db3ec041d33f29d3ace0e0ca7a3643 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/18] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 2c014990d7cabd857e083e0ac251d5a1a2c44497 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/18] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From ad39f276bbf08e7f46e82254e5dfe05e0eac66ca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/18] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From dab4452e67bcaeab84a0dd9b57e42c2794939d96 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/18] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 6575511ac94de71e86bee37bbe1eb9ac035b34bb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/18] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From cfb10130dbbe37aa8eaf3ebbcb6c8ba830eea236 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/18] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From a227b2c3d4d2d874b07df6b09de77824c37093f1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/18] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 74116ebc192456de70491ac34c64b0222efde682 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/18] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From b6b4447de6417801abb7ddb9a4c148c7328d9639 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/18] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From dc093beccdff4269e28883f1e1ac6044af192586 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/18] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 9124558c136377ee1417486e7ba3b351d5321eb6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/18] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b79afad74cea41a0637fd8529ea72b64e2c22e32 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/18] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 7c3e77332a91c1c6edee94f525cba001196c9131 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/18] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 9f7e9b679d0fc46301afe5472f2cd9f0627d83ef Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/18] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From b2d458256c4a9df1afd200c9bf1f7f352cdcaa98 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/18] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (65 preceding siblings ...)
  2023-02-10 16:42 ` tranzystorek-io
@ 2023-02-10 19:21 ` tranzystorek-io
  2023-02-15 17:27 ` tranzystorek-io
                   ` (27 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-10 19:21 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [ ] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From fb0c52ffe973a6110b9bf45c87af5b24386fb919 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/19] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 .../compiler-rt-xray-ppc64-musl.patch.skip    |  62 +++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 .../llvm15/patches/libunwind-ppc32.patch.skip |  63 +++
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 25 files changed, 1188 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 504d29f4cb98..7c1c48c61065 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,6 +992,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
new file mode 100644
index 000000000000..d0b61c80c897
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-xray-ppc64-musl.patch.skip
@@ -0,0 +1,62 @@
+--- a/compiler-rt/lib/xray/xray_powerpc64.inc
++++ b/compiler-rt/lib/xray/xray_powerpc64.inc
+@@ -12,7 +12,13 @@
+ 
+ #include <cstdint>
+ #include <mutex>
++#ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
++#else
++#include <cctype>
++#include <cstring>
++#include <cstdlib>
++#endif
+ 
+ #include "xray_defs.h"
+ 
+@@ -20,13 +26,45 @@ namespace __xray {
+ 
+ ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
+   CPU = 0;
++#ifdef __GLIBC__
+   return __ppc_get_timebase();
++#else
++  return __builtin_ppc_get_timebase();
++#endif
+ }
+ 
+ inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
+   static std::mutex M;
+   std::lock_guard<std::mutex> Guard(M);
++#ifdef __GLIBC__
+   return __ppc_get_timebase_freq();
++#else
++  /* FIXME: a less dirty implementation? */
++  static uint64_t base;
++  if (!base) {
++    FILE *f = fopen("/proc/cpuinfo", "rb");
++    if (f) {
++      ssize_t nr;
++      /* virtually always big enough to hold the line */
++      char buf[512];
++      while (fgets(buf, sizeof(buf), f)) {
++        char *ret = strstr(buf, "timebase");
++        if (!ret) {
++          continue;
++        }
++        ret += sizeof("timebase") - 1;
++        ret = strchr(ret, ':');
++        if (!ret) {
++          continue;
++        }
++        base = strtoul(ret + 1, nullptr, 10);
++        break;
++      }
++      fclose(f);
++    }
++  }
++  return base;
++#endif
+ }
+ 
+ inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
new file mode 100644
index 000000000000..74aa7576ecf9
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libunwind-ppc32.patch.skip
@@ -0,0 +1,63 @@
+This fixes build at least with gcc9 which does not define `__ppc__`.
+
+--- a/libunwind/include/__libunwind_config.h
++++ b/libunwind/include/__libunwind_config.h
+@@ -49,7 +49,7 @@
+ #  define _LIBUNWIND_CONTEXT_SIZE 167
+ #  define _LIBUNWIND_CURSOR_SIZE 179
+ #  define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
+-# elif defined(__ppc__)
++# elif defined(__powerpc__)
+ #  define _LIBUNWIND_TARGET_PPC 1
+ #  define _LIBUNWIND_CONTEXT_SIZE 117
+ #  define _LIBUNWIND_CURSOR_SIZE 124
+--- a/libunwind/src/UnwindRegistersRestore.S
++++ b/libunwind/src/UnwindRegistersRestore.S
+@@ -392,7 +392,7 @@ Lnovec:
+   PPC64_LR(3)
+   bctr
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
+ //
+--- a/libunwind/src/UnwindRegistersSave.S
++++ b/libunwind/src/UnwindRegistersSave.S
+@@ -554,7 +554,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
+   blr
+ 
+ 
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ 
+ //
+ // extern int unw_getcontext(unw_context_t* thread_state)
+--- a/libunwind/src/config.h
++++ b/libunwind/src/config.h
+@@ -95,12 +95,12 @@
+ #define _LIBUNWIND_BUILD_SJLJ_APIS
+ #endif
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || defined(__powerpc64__)
+ #define _LIBUNWIND_SUPPORT_FRAME_APIS
+ #endif
+ 
+ #if defined(__i386__) || defined(__x86_64__) ||                                \
+-    defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__) ||        \
++    defined(__powerpc__) || defined(__powerpc64__) ||                          \
+     (!defined(__APPLE__) && defined(__arm__)) ||                               \
+     (defined(__arm64__) || defined(__aarch64__)) ||                            \
+     defined(__mips__)
+--- a/libunwind/src/libunwind.cpp
++++ b/libunwind/src/libunwind.cpp
+@@ -42,7 +42,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
+ # define REGISTER_KIND Registers_x86_64
+ #elif defined(__powerpc64__)
+ # define REGISTER_KIND Registers_ppc64
+-#elif defined(__ppc__)
++#elif defined(__powerpc__)
+ # define REGISTER_KIND Registers_ppc
+ #elif defined(__aarch64__)
+ # define REGISTER_KIND Registers_arm64
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 016ed775e5f482f98a2ede7a10bc24b0069eb0e0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/19] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7c1c48c61065..44059d647598 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 6ffb3cba2fc9858ba7d8c4134f5c717ffa7fb9bd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/19] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From f107c174d7db3ec041d33f29d3ace0e0ca7a3643 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/19] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 2c014990d7cabd857e083e0ac251d5a1a2c44497 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/19] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From ad39f276bbf08e7f46e82254e5dfe05e0eac66ca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/19] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From dab4452e67bcaeab84a0dd9b57e42c2794939d96 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/19] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 6575511ac94de71e86bee37bbe1eb9ac035b34bb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/19] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From cfb10130dbbe37aa8eaf3ebbcb6c8ba830eea236 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/19] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From a227b2c3d4d2d874b07df6b09de77824c37093f1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/19] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 74116ebc192456de70491ac34c64b0222efde682 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/19] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From b6b4447de6417801abb7ddb9a4c148c7328d9639 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/19] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From dc093beccdff4269e28883f1e1ac6044af192586 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/19] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 9124558c136377ee1417486e7ba3b351d5321eb6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/19] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From b79afad74cea41a0637fd8529ea72b64e2c22e32 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/19] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 7c3e77332a91c1c6edee94f525cba001196c9131 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/19] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 9f7e9b679d0fc46301afe5472f2cd9f0627d83ef Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/19] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From b2d458256c4a9df1afd200c9bf1f7f352cdcaa98 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/19] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From b3812ef08fb46263d4e1684e75c9e31222ac6359 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/19] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (66 preceding siblings ...)
  2023-02-10 19:21 ` tranzystorek-io
@ 2023-02-15 17:27 ` tranzystorek-io
  2023-02-16 19:17 ` tranzystorek-io
                   ` (26 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-15 17:27 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [ ] Adjust patches marked as `.patch.skip`
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [ ] ghdl (2.0.0 supports LLVM `<= 14`)
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From cc2eed74c2b16ca79fd5d987d9661440ed1e1282 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/19] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index f9a0d7794b79..501dbbce7846 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From cc0c0f8a0c554c5b7d542e30bcf165643c4c2311 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/19] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 501dbbce7846..e8056352cef6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 05f9377069fb4416137fe498a5e2fbeef248d39e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/19] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From b6401be9755f9a992324f91f18f134b6102bb1ae Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/19] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From e1baee5db88f77206c706f0f0321a21344c08383 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/19] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 170bc933b5d6fe68c56e667cdb3848be036163b6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/19] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From f5863efce7516ad698d26a8bc9a976d203a5e82e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/19] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 008fef21f20fad39388e57ed1a53c999f3872224 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/19] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 0fd7c0fdd30de72139195f1571e6a1ae7ba8d6a0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/19] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 8d86ed98b004f414eea7fc63e2cff783a42bc910 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/19] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 070871966522cec2b30ae6b62fd1986ebb32cb4c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/19] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 32e49aac388d03f2caea90d7c0d96913ac8a0a57 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/19] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 1921c06551405c3320510e22c300a7e97adf45b7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/19] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From eb1da229f860a899d2d9e1892acbd751bbbc4cb2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/19] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From e83fe9f21bf237b9e19f197853eeec6d4740264c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/19] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From a04cdbfe671cbbbe256266b15fab581c84f20dc6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/19] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 13114afb5390d0e48ea340a90e430f00ba2c5d6a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/19] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 1eee3ba155f2ec9f7eacd90f7207917bc243a2a4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/19] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From d49a7165718f92aaa90820ac29fc0f79159cb851 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/19] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (67 preceding siblings ...)
  2023-02-15 17:27 ` tranzystorek-io
@ 2023-02-16 19:17 ` tranzystorek-io
  2023-02-16 22:44 ` tranzystorek-io
                   ` (25 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-16 19:17 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [ ] clazy (breaking changes in clang API)
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From cc2eed74c2b16ca79fd5d987d9661440ed1e1282 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/20] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index f9a0d7794b79..501dbbce7846 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From cc0c0f8a0c554c5b7d542e30bcf165643c4c2311 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/20] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 501dbbce7846..e8056352cef6 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 05f9377069fb4416137fe498a5e2fbeef248d39e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/20] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From b6401be9755f9a992324f91f18f134b6102bb1ae Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/20] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From e1baee5db88f77206c706f0f0321a21344c08383 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/20] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 170bc933b5d6fe68c56e667cdb3848be036163b6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/20] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From f5863efce7516ad698d26a8bc9a976d203a5e82e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/20] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 008fef21f20fad39388e57ed1a53c999f3872224 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/20] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 0fd7c0fdd30de72139195f1571e6a1ae7ba8d6a0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/20] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 8d86ed98b004f414eea7fc63e2cff783a42bc910 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/20] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 070871966522cec2b30ae6b62fd1986ebb32cb4c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/20] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 32e49aac388d03f2caea90d7c0d96913ac8a0a57 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/20] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 1921c06551405c3320510e22c300a7e97adf45b7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/20] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From eb1da229f860a899d2d9e1892acbd751bbbc4cb2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/20] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From e83fe9f21bf237b9e19f197853eeec6d4740264c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/20] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From a04cdbfe671cbbbe256266b15fab581c84f20dc6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/20] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 13114afb5390d0e48ea340a90e430f00ba2c5d6a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/20] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 1eee3ba155f2ec9f7eacd90f7207917bc243a2a4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/20] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From d49a7165718f92aaa90820ac29fc0f79159cb851 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/20] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 53592868b17f741d077d645311701699a6964851 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/20] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (68 preceding siblings ...)
  2023-02-16 19:17 ` tranzystorek-io
@ 2023-02-16 22:44 ` tranzystorek-io
  2023-02-18 19:34 ` tranzystorek-io
                   ` (24 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-16 22:44 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`)
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [ ] qtcreator (breaking changes in clang-format API)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From 3a5f19871590ddcd7af7baa01493517ca26ce4b7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/23] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 0c1d545fbe27..661979817442 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From b7100e9d6a5681bf7aeeeb41612ffbba83f2875a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/23] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 661979817442..ce67bf777dab 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From cbb85722dcbdc9242ed7dc18e9407d6f41f17376 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/23] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 47ef2f192c4f2bd5f8751b5651e4cbc256c67d01 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/23] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From d0a13a86a8b7b4033aba158d8538a5fd947c981f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/23] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From a5112ebd26157044b288b9f71a74158f004c2907 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/23] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From 04e81bf7953fa386072a0878df05ccaf36a1998f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/23] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From a80fcca7a2514f351d031fae7d9b5ac983f6c63a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/23] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From bd2a87867612261270082ecb9f3b62e706f33b83 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/23] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 727334da98ef18ca0452ea1d18bba052f9195384 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/23] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 1029b66414dbcecbe9c9e8459e8d003d0e52a805 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/23] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 4f5f4e9d0e2137b004eeb1f49d02f49d7f9651a8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/23] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 3cab7ce7d61c8b975001771e25023ffb6f2f3e58 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/23] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From a24b7a7eb3341d46b1f40ff4209a3a3ca09a4000 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/23] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 8f831699378943712e344107c90fb688e6c650c1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/23] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 4011610a26012d34d96e44c0e2521c15995731cb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/23] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From e552238fcd8f07d2d3ce28f2918054f0f287569a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/23] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 0a64dca9732bc9ac1b8714f412287c99ad1e4c5e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/23] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From e4ab5a205df613191c469981bc37c2d5efbeb855 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/23] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From fe5a916917c10e03d546e79b43e50189c5d9bd38 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/23] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 6b8c43986cb95c10c657793d75b77d103b92d9ef Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/23] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index ce67bf777dab..fe2468e967c2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2187,10 +2187,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From 18a8d9ffd048c0cd79b3707cc97ea965d5b6aadd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/23] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From e927d81fddf85e39991b62f7aa3f37d6821af032 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/23] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (69 preceding siblings ...)
  2023-02-16 22:44 ` tranzystorek-io
@ 2023-02-18 19:34 ` tranzystorek-io
  2023-02-19 22:34 ` simvux
                   ` (23 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-18 19:34 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [ ] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151)
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [ ] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From 77192e26297e55be95aa415482ae561788c40bf0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/24] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 0c1d545fbe27..661979817442 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,6 +990,9 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From b8ff70a79594482c06e1a94c1bc92753aa57e865 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/24] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 661979817442..ce67bf777dab 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 3c8383866a036f18e4a52542153245e00c243bff Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/24] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 5e75b9baa1e482efd376555f49124908138c4f0b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/24] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 4c3c9ec6039e..0641b28a80d6 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.2.4
-revision=2
+revision=3
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From ab54aa0587a7d7a0c8d603f2d04258c3d25ef5da Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/24] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 76d4020a2af5401e7777fd0a73f9c3ad322b5421 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/24] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From 6e1b2a3c804a52a1c324a0b414eb512f9afd9878 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/24] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 8a5060dff47565898399678552f32dbc0e77a023 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/24] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 39e1c126e215858a21ea0ff31bada898fac7dabd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/24] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From f11d8164722ffc9fa2b8e11db5365052fc9a5c1d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/24] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From c7dec6bf01db99ed272a33e7c2cd84ca383803ad Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/24] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From ab490fd732091b5f41b8d1e419cf908f3b34ae3e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/24] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 0fb522141d6ae71350151e70460ee37f295b1364 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/24] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 842f22af2dc42c10fadc6bb15dd2183ec1963ea0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/24] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 06b287d3c33c6255bdf1271295a93f6c5c6e5cde Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/24] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From a9c61968094d283ce91de5624b31f7f55e7434c2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/24] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 106e026c9f8cbed2f2216808f80d583704029b7e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/24] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From ac360173b5fa896fb793cbae049c9a20f80ecf9a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/24] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 25a788aa047e6d91ae9b037d64dc421d170ac424 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/24] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 10fd0fd7aabbd47988d9abb0181d3f32c42ef025 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/24] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 508ff6858e94d4e958e1014514573af5a6ee180c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/24] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index ce67bf777dab..fe2468e967c2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2187,10 +2187,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From 4d1fb9acf6189ba68941283a43ba4810c1708aca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/24] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From 22ba792b7152f6f94fdc5edb01d57b766c8b151d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/24] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From 5909ea0cd914afd89583a38bbb4b8ea80521a898 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/24] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index e42840bf6fe4..b1dffd304198 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF
  -DQT_HOST_PATH=/usr/ -DQT_HOST_PATH_CMAKE_DIR=/usr/lib64/cmake/Qt6"

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (70 preceding siblings ...)
  2023-02-18 19:34 ` tranzystorek-io
@ 2023-02-19 22:34 ` simvux
  2023-02-20  9:59 ` cmueller-tp
                   ` (22 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: simvux @ 2023-02-19 22:34 UTC (permalink / raw)
  To: ml

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

New comment by simvux on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1436116067

Comment:
Thank you for all your work on this <3 

Looking forward to seeing it in my `xi -Su`

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

* Re: [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (71 preceding siblings ...)
  2023-02-19 22:34 ` simvux
@ 2023-02-20  9:59 ` cmueller-tp
  2023-02-22 12:35 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (21 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: cmueller-tp @ 2023-02-20  9:59 UTC (permalink / raw)
  To: ml

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

New comment by cmueller-tp on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1436664531

Comment:
Will this be abandoned again once they tag the 16.0 as stable? They've already tagged RC2 2 weeks ago.

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (72 preceding siblings ...)
  2023-02-20  9:59 ` cmueller-tp
@ 2023-02-22 12:35 ` tranzystorek-io
  2023-02-22 14:35 ` tranzystorek-io
                   ` (20 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-22 12:35 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [ ] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [ ] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151)
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From b6b4452247770b7754a887a7c4363632701369a0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/25] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 2028226606bc..f8da02805ce0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -991,6 +991,9 @@ libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 42cecc096e46f473b902e822beb92c536f2d0065 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/25] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index f8da02805ce0..e7258d15c26e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 51a8784ccdbed57e9c45b4459194770c90697df2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/25] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From ce42989823df39522df8e5db384ddbc1ff978d22 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 04/25] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 627e223ec446a9347a60f0f40734947ff31755fd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 05/25] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 5121c1265d838ee64b917e81cd1f11c7ba3b5d42 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 06/25] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From ccbb527fc7135002c49aac97df39bdcb89f3d703 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 07/25] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From f153a08c0d96cc07daa7f02b3406b84afaa313e9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 08/25] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From c05c31b8dbed01e6ab2c253b9349adc719558594 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 09/25] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 38d5bf75e6f31b3249ea475b6705eb3f7a071e47 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 10/25] SPIRV-LLVM-Translator: update to 15.0.0

---
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 1850b1b49eb6d9adcde4d1262610a5c770e450a0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/25] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From aeb9bab1d5bc5a9afa61f5dc70f71e20b39d48c7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/25] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 725ba95cbbe14ecca69f6889b01363b82a66b3e8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/25] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From e1ea4040f771a9cfcc5f24e326426aadbd1cd882 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/25] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 2a8628f922d7afbecb7ac8306ef0d57c67d6763a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/25] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 0cb11022e0290441b9975ad2e8a7724e05b8d7e5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/25] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From ee9d0b09e6a42d7b719b514b6175dc1897d93460 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/25] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 1438db23b213a4210310deaf000df024affa4adc Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/25] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From f0be927297ebdbf5756a3a5cfcefe0be47adc1e8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/25] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From a9e4b7dc6bd8fadf4f3ef018cbce92c678b7ce5a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/25] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 88e977ca25c23b0bc9e3bebc2adb3c93c3b996cb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/25] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index e7258d15c26e..2e606f5a67e4 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2188,10 +2188,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From a648b2feadd7a92e473ae1881f579f82adb936b5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/25] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From b36fa1d77d8dcdb72aa4952af6d2f8cbae093f7f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/25] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From 5b32834dde54c895fde289bb907eacb97e40d4d6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/25] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index e42840bf6fe4..b1dffd304198 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF
  -DQT_HOST_PATH=/usr/ -DQT_HOST_PATH_CMAKE_DIR=/usr/lib64/cmake/Qt6"

From b920196fed70d22534dc9abf21e8aa0b156d2da3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/25] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..bc709e4ec4b3 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,9 +1,12 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
+patch_args="-d ${build_wrksrc} -Np1"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
  librsvg tar AppStream"
 makedepends="dconf-devel gtkd-devel libglib-devel libvted-devel libX11-devel"
@@ -13,8 +16,14 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (73 preceding siblings ...)
  2023-02-22 12:35 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-02-22 14:35 ` tranzystorek-io
  2023-02-22 19:26 ` tranzystorek-io
                   ` (19 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-22 14:35 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From 7fd4c98ece2630d2ea22098a1970ba4134784a18 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/25] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 2028226606bc..435de5edf596 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,7 +990,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 80c94cd17d46e6b3be6bff98bee945d57e39d7f9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/25] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 435de5edf596..07004ce71c0b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From d128437622eff58ae6e9b6d41bcd93f8db5b5c04 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/25] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From f996173a44904b2872d72cbb08c88e7f74804742 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/25] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 07004ce71c0b..66818d478a6f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -991,7 +991,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From becd4701aeaeddf1a8a9d924fd223d8802fcbac7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/25] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 67b601d616d3e57bdc6c0e00d7a63563edb22b8d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/25] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 3e612349230d0628e779ffdd216a3c4ec7562c68 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/25] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From ee00abd397a6912755f9f344c173cb4a58dd3302 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/25] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From d9538506ae92dda0f2949059d498f4948e3abe26 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/25] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 666679e525f53a0b7cdcc6d59f2a6bd12980a3ba Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/25] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 8f4646dfa3c315f4781894683c7e01625d82df3f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/25] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From c758fa3ad4f9946e1b9de9e9a7c048565024effd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/25] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 296e90c9859d9bd9c97acd5a7681ee0f23099dc5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/25] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 7ec407b7ba41ed8aacc29fbf32eb6f8e2ab8745f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/25] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 1560155a677110069803f548c641620a431a5299 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/25] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 5b1c35f6991ee994d5dc2d850e59cdf273a4e93f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/25] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 14c558f0da1b77a48fec82feb00d173b6e1c93ec Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/25] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 6ec7abb1d157e4a2ea96d4de659b4ffb365d0c29 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/25] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 017335a126278ae846e746ef05f8977c7cc2a9a4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/25] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 726a18e1f510326cee9695e5a8ee8cfc5c905340 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/25] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 8cede6ce3bf37aa03eba527f64aef0766a050421 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/25] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index 66818d478a6f..749306c97cc8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2188,10 +2188,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From dd09a8b46f8abe912f0dd4e27bda629fa6bfa7ca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/25] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From 65681b8bcb48ffc92a386e78ab6a4150f55ec94b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/25] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From 64ea9467ad3ffec373f2686fb5abb3252cb80f57 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/25] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index e42840bf6fe4..b1dffd304198 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF
  -DQT_HOST_PATH=/usr/ -DQT_HOST_PATH_CMAKE_DIR=/usr/lib64/cmake/Qt6"

From 856324bca62603aab0af9c9f1faef72c5fd37684 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/25] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..bc709e4ec4b3 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,9 +1,12 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
+patch_args="-d ${build_wrksrc} -Np1"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
  librsvg tar AppStream"
 makedepends="dconf-devel gtkd-devel libglib-devel libvted-devel libX11-devel"
@@ -13,8 +16,14 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

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

* Re: [PR PATCH] [Updated] [WIP] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (74 preceding siblings ...)
  2023-02-22 14:35 ` tranzystorek-io
@ 2023-02-22 19:26 ` tranzystorek-io
  2023-02-22 19:41 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (18 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-22 19:26 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

[WIP] LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [ ] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From 7fd4c98ece2630d2ea22098a1970ba4134784a18 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 2028226606bc..435de5edf596 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,7 +990,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 80c94cd17d46e6b3be6bff98bee945d57e39d7f9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 435de5edf596..07004ce71c0b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From d128437622eff58ae6e9b6d41bcd93f8db5b5c04 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From f996173a44904b2872d72cbb08c88e7f74804742 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 07004ce71c0b..66818d478a6f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -991,7 +991,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From becd4701aeaeddf1a8a9d924fd223d8802fcbac7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 67b601d616d3e57bdc6c0e00d7a63563edb22b8d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 3e612349230d0628e779ffdd216a3c4ec7562c68 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From ee00abd397a6912755f9f344c173cb4a58dd3302 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From d9538506ae92dda0f2949059d498f4948e3abe26 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 666679e525f53a0b7cdcc6d59f2a6bd12980a3ba Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 8f4646dfa3c315f4781894683c7e01625d82df3f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From c758fa3ad4f9946e1b9de9e9a7c048565024effd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 296e90c9859d9bd9c97acd5a7681ee0f23099dc5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 7ec407b7ba41ed8aacc29fbf32eb6f8e2ab8745f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 1560155a677110069803f548c641620a431a5299 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 5b1c35f6991ee994d5dc2d850e59cdf273a4e93f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 14c558f0da1b77a48fec82feb00d173b6e1c93ec Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 6ec7abb1d157e4a2ea96d4de659b4ffb365d0c29 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 017335a126278ae846e746ef05f8977c7cc2a9a4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 726a18e1f510326cee9695e5a8ee8cfc5c905340 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 8cede6ce3bf37aa03eba527f64aef0766a050421 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index 66818d478a6f..749306c97cc8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2188,10 +2188,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From dd09a8b46f8abe912f0dd4e27bda629fa6bfa7ca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From 65681b8bcb48ffc92a386e78ab6a4150f55ec94b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From 64ea9467ad3ffec373f2686fb5abb3252cb80f57 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index e42840bf6fe4..b1dffd304198 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF
  -DQT_HOST_PATH=/usr/ -DQT_HOST_PATH_CMAKE_DIR=/usr/lib64/cmake/Qt6"

From 856324bca62603aab0af9c9f1faef72c5fd37684 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..bc709e4ec4b3 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,9 +1,12 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
+patch_args="-d ${build_wrksrc} -Np1"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
  librsvg tar AppStream"
 makedepends="dconf-devel gtkd-devel libglib-devel libvted-devel libX11-devel"
@@ -13,8 +16,14 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From c18de3bdafb53b646196e5b6b026a1de24d83294 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 20:25:19 +0100
Subject: [PATCH 26/26] ispc: update to 1.18.1.r290+e88e49e

---
 .../ispc/patches/cmake-build-type-none.patch  |   25 +-
 srcpkgs/ispc/patches/llvm12-001.patch         |   57 -
 srcpkgs/ispc/patches/llvm12-002.patch         |  923 --------
 srcpkgs/ispc/patches/llvm12-003.patch         | 1504 ------------
 srcpkgs/ispc/patches/llvm12-004.patch         |   34 -
 srcpkgs/ispc/patches/llvm12-005.patch         |  372 ---
 srcpkgs/ispc/patches/llvm12-006.patch         |  126 -
 srcpkgs/ispc/patches/llvm12-007.patch         |  160 --
 srcpkgs/ispc/patches/llvm12-008.patch         |  149 --
 srcpkgs/ispc/patches/llvm12-009.patch         | 2109 -----------------
 srcpkgs/ispc/template                         |   13 +-
 11 files changed, 17 insertions(+), 5455 deletions(-)
 delete mode 100644 srcpkgs/ispc/patches/llvm12-001.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-002.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-003.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-004.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-005.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-006.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-007.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-008.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-009.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
index 411e353c7314..a962619d9335 100644
--- a/srcpkgs/ispc/patches/cmake-build-type-none.patch
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -1,18 +1,13 @@
-Index: ispc-1.15.0/CMakeLists.txt
-===================================================================
---- ispc-1.15.0.orig/CMakeLists.txt
-+++ ispc-1.15.0/CMakeLists.txt
-@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
  
  if(CMAKE_BUILD_TYPE)
--    # Validate build type
+     # Validate build type
 -    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
--
--    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
--    if (${MATCHED_CONFIG} EQUAL -1)
--         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
--    endif()
- else(NOT CMAKE_BUILD_TYPE)
-     set(CMAKE_BUILD_TYPE "Release")
-     message(STATUS "Build type not specified: Use Release by default.")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/patches/llvm12-001.patch b/srcpkgs/ispc/patches/llvm12-001.patch
deleted file mode 100644
index 5f2d3f5a409e..000000000000
--- a/srcpkgs/ispc/patches/llvm12-001.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 1c0f89dccb774f216c7f6e76a99ee907a1e641cb Mon Sep 17 00:00:00 2001
-From: Dmitry Babokin <dmitry.y.babokin@intel.com>
-Date: Tue, 22 Dec 2020 17:03:59 -0800
-Subject: [PATCH] Fix to work with LLVM trunk after llvm/llvm-project@41c3b2713
-
----
- src/ctx.cpp | 18 ++++++++++++------
- 1 file changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 6fbb8b9cf..977e9d222 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1473,11 +1473,15 @@ void FunctionEmitContext::AddDebugPos(llvm::Value *value, const SourcePos *pos,
-     llvm::Instruction *inst = llvm::dyn_cast<llvm::Instruction>(value);
-     if (inst != NULL && m->diBuilder) {
-         SourcePos p = pos ? *pos : currentPos;
--        if (p.first_line != 0)
-+        if (p.first_line != 0) {
-             // If first_line == 0, then we're in the middle of setting up
-             // the standard library or the like; don't add debug positions
-             // for those functions
--            inst->setDebugLoc(llvm::DebugLoc::get(p.first_line, p.first_column, scope ? scope : GetDIScope()));
-+            scope = scope ? scope : GetDIScope();
-+            llvm::DebugLoc diLoc =
-+                llvm::DILocation::get(scope->getContext(), p.first_line, p.first_column, scope, nullptr, false);
-+            inst->setDebugLoc(diLoc);
-+        }
-     }
- }
- 
-@@ -1518,9 +1522,10 @@ void FunctionEmitContext::EmitVariableDebugInfo(Symbol *sym) {
-     llvm::DILocalVariable *var = m->diBuilder->createAutoVariable(
-         scope, sym->name, sym->pos.GetDIFile(), sym->pos.first_line, diType, true /* preserve through opts */);
- 
-+    llvm::DebugLoc diLoc =
-+        llvm::DILocation::get(scope->getContext(), sym->pos.first_line, sym->pos.first_column, scope, nullptr, false);
-     llvm::Instruction *declareInst =
--        m->diBuilder->insertDeclare(sym->storagePtr, var, m->diBuilder->createExpression(),
--                                    llvm::DebugLoc::get(sym->pos.first_line, sym->pos.first_column, scope), bblock);
-+        m->diBuilder->insertDeclare(sym->storagePtr, var, m->diBuilder->createExpression(), diLoc, bblock);
-     AddDebugPos(declareInst, &sym->pos, scope);
- }
- 
-@@ -1535,9 +1540,10 @@ void FunctionEmitContext::EmitFunctionParameterDebugInfo(Symbol *sym, int argNum
-         m->diBuilder->createParameterVariable(scope, sym->name, argNum + 1, sym->pos.GetDIFile(), sym->pos.first_line,
-                                               diType, true /* preserve through opts */, flags);
- 
-+    llvm::DebugLoc diLoc =
-+        llvm::DILocation::get(scope->getContext(), sym->pos.first_line, sym->pos.first_column, scope, nullptr, false);
-     llvm::Instruction *declareInst =
--        m->diBuilder->insertDeclare(sym->storagePtr, var, m->diBuilder->createExpression(),
--                                    llvm::DebugLoc::get(sym->pos.first_line, sym->pos.first_column, scope), bblock);
-+        m->diBuilder->insertDeclare(sym->storagePtr, var, m->diBuilder->createExpression(), diLoc, bblock);
-     AddDebugPos(declareInst, &sym->pos, scope);
- }
- 
diff --git a/srcpkgs/ispc/patches/llvm12-002.patch b/srcpkgs/ispc/patches/llvm12-002.patch
deleted file mode 100644
index 0903f30da10d..000000000000
--- a/srcpkgs/ispc/patches/llvm12-002.patch
+++ /dev/null
@@ -1,923 +0,0 @@
-From 0597a79d084c014780136da906afe21d15e982cb Mon Sep 17 00:00:00 2001
-From: DeepakRajendrakumaran <deepak.rajendrakumaran@intel.com>
-Date: Tue, 5 Jan 2021 13:53:30 -0800
-Subject: [PATCH] Remove LLVM 8.0 and LLVM 9.0. (#1966)
-
----
- .appveyor.yml                        |  3 --
- .travis.yml                          |  7 ---
- CMakeLists.txt                       | 12 ++----
- src/ast.cpp                          |  4 --
- src/ctx.cpp                          | 30 -------------
- src/gen/GlobalsLocalization.cpp      |  4 --
- src/ispc.cpp                         | 20 ---------
- src/ispc.h                           |  3 +-
- src/ispc_version.h                   |  4 +-
- src/main.cpp                         | 13 ------
- src/module.cpp                       | 27 ------------
- src/module.h                         |  2 -
- src/opt.cpp                          | 64 ++--------------------------
- src/type.cpp                         | 10 ++---
- tests/lit-tests/1771.ispc            |  1 -
- tests/lit-tests/1844.ispc            |  3 --
- tests/lit-tests/1926.ispc            |  2 -
- tests/lit-tests/cpus_x86.ispc        |  2 +
- tests/lit-tests/cpus_x86_llvm10.ispc | 11 -----
- tests/lit-tests/lit.cfg              |  5 ---
- 20 files changed, 14 insertions(+), 213 deletions(-)
- delete mode 100644 tests/lit-tests/cpus_x86_llvm10.ispc
-
-diff --git a/.appveyor.yml b/.appveyor.yml
-index 451a7b3e0..7945cca2a 100644
---- a/.appveyor.yml
-+++ b/.appveyor.yml
-@@ -41,8 +41,6 @@ environment:
-       LLVM_VERSION: latest
-     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
-       LLVM_VERSION: 10.0
--    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
--      LLVM_VERSION: 9.0
- 
- for:
- -
-@@ -62,7 +60,6 @@ for:
-         if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( (set generator="Visual Studio 16") & (set vsversion=2019))
-         set LLVM_TAR=llvm-11.0.0-win.vs2019-Release+Asserts-x86.arm.wasm.7z
-         if "%LLVM_VERSION%"=="10.0" (set LLVM_TAR=llvm-10.0.1-win.vs2019-Release+Asserts-x86.arm.wasm.zip)
--        if "%LLVM_VERSION%"=="9.0" (set LLVM_TAR=llvm-9.0.1-win.vs2017-Release+Asserts-x86.arm.wasm.zip)
-   install:
-     - ps: choco install --no-progress winflexbison3 wget 7zip
-     - cmd: |-
-diff --git a/.travis.yml b/.travis.yml
-index 2e96017a6..3a6b85264 100644
---- a/.travis.yml
-+++ b/.travis.yml
-@@ -108,13 +108,6 @@ jobs:
-         - LLVM_TAR=llvm-10.0.1-ubuntu16.04-Release+Asserts-x86.arm.wasm.tar.xz
-         - LLVM_REPO=https://github.com/dbabokin/llvm-project
-         - ISPC_HOME=$TRAVIS_BUILD_DIR
--    # LLVM 9.0 + Ubuntu 16.04: build, lit tests, examples (build + run), benchmarks (build + trial run)
--    - <<: *my_tag
--      env:
--        - LLVM_VERSION=9.0 OS=Ubuntu16.04
--        - LLVM_TAR=llvm-9.0.1-ubuntu16.04-Release+Asserts-x86.arm.wasm.tar.xz
--        - LLVM_REPO=https://github.com/dbabokin/llvm-project
--        - ISPC_HOME=$TRAVIS_BUILD_DIR
-     # WASM enabled build
-     # LLVM 11.0 + Ubuntu 16.04: build, lit tests, examples (build), benchmarks (build + trial run)
-     - <<: *my_tag
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 5fa863fcf..a6b3ed251 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -241,10 +241,8 @@ if (X86_ENABLED)
-         avx2-i8x32 avx2-i16x16
-         avx2-i32x4 avx2-i32x8 avx2-i32x16 avx2-i64x4
-         avx512knl-i32x16
--        avx512skx-i32x16 avx512skx-i32x8)
--    if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
--        list(APPEND ISPC_TARGETS avx512skx-i8x64 avx512skx-i16x32)
--    endif()
-+        avx512skx-i32x16 avx512skx-i32x8
-+        avx512skx-i8x64 avx512skx-i16x32)
- endif()
- if (ARM_ENABLED)
-     list(APPEND ISPC_TARGETS neon-i8x16 neon-i16x8 neon-i32x4 neon-i32x8)
-@@ -259,11 +257,7 @@ if (WASM_ENABLED)
- endif()
- 
- set(CLANG_LIBRARY_LIST clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangAST clangBasic clangEdit clangLex)
--set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option)
--
--if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
--    list(APPEND LLVM_COMPONENTS frontendopenmp)
--endif()
-+set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option frontendopenmp)
- 
- if (X86_ENABLED)
-     list(APPEND LLVM_COMPONENTS x86)
-diff --git a/src/ast.cpp b/src/ast.cpp
-index 20f75a29c..5a43c4854 100644
---- a/src/ast.cpp
-+++ b/src/ast.cpp
-@@ -44,9 +44,7 @@
- #include "sym.h"
- #include "util.h"
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
- #include <llvm/Support/TimeProfiler.h>
--#endif
- ///////////////////////////////////////////////////////////////////////////
- // ASTNode
- 
-@@ -62,9 +60,7 @@ void AST::AddFunction(Symbol *sym, Stmt *code) {
- }
- 
- void AST::GenerateIR() {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope TimeScope("GenerateIR");
--#endif
-     for (unsigned int i = 0; i < functions.size(); ++i)
-         functions[i]->GenerateIR();
- }
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 977e9d222..42c4ea09d 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -309,21 +309,13 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym, llvm::F
-             char buf[256];
-             snprintf(buf, sizeof(buf), "__off_all_on_mask_%s", g->target->GetISAString());
- 
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_8_0
--            llvm::Constant *offFunc = m->module->getOrInsertFunction(buf, LLVMTypes::VoidType);
--#else // LLVM 9.0+
-             llvm::FunctionCallee offFuncCallee = m->module->getOrInsertFunction(buf, LLVMTypes::VoidType);
-             llvm::Constant *offFunc = llvm::cast<llvm::Constant>(offFuncCallee.getCallee());
--#endif
-             AssertPos(currentPos, llvm::isa<llvm::Function>(offFunc));
-             llvm::BasicBlock *offBB = llvm::BasicBlock::Create(*g->ctx, "entry", (llvm::Function *)offFunc, 0);
-             llvm::StoreInst *inst = new llvm::StoreInst(LLVMMaskAllOff, globalAllOnMaskPtr, offBB);
-             if (g->opt.forceAlignedMemory) {
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                inst->setAlignment(g->target->getNativeVectorAlignment());
--#else // LLVM 10.0+
-                 inst->setAlignment(llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne());
--#endif
-             }
-             llvm::ReturnInst::Create(*g->ctx, offBB);
-         }
-@@ -2288,11 +2280,7 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, c
- #endif
- 
-     if (g->opt.forceAlignedMemory && llvm::dyn_cast<llvm::VectorType>(pt->getElementType())) {
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--        inst->setAlignment(g->target->getNativeVectorAlignment());
--#else // LLVM 10.0+
-         inst->setAlignment(llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne());
--#endif
-     }
- 
-     AddDebugPos(inst);
-@@ -2431,11 +2419,7 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
-                 // vs the proper alignment in practice.)
-                 int align = 1;
- 
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                inst->setAlignment(align);
--#else // LLVM 10.0+
-                 inst->setAlignment(llvm::MaybeAlign(align).valueOrOne());
--#endif
-             }
- 
-             AddDebugPos(inst);
-@@ -2649,11 +2633,7 @@ llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const char *n
-         align = g->target->getNativeVectorAlignment();
- 
-     if (align != 0) {
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--        inst->setAlignment(align);
--#else // LLVM 10.0+
-         inst->setAlignment(llvm::MaybeAlign(align).valueOrOne());
--#endif
-     }
-     // Don't add debugging info to alloca instructions
-     return inst;
-@@ -2926,11 +2906,7 @@ void FunctionEmitContext::StoreInst(llvm::Value *value, llvm::Value *ptr, const
-     llvm::StoreInst *inst = new llvm::StoreInst(value, ptr, bblock);
- 
-     if (g->opt.forceAlignedMemory && llvm::dyn_cast<llvm::VectorType>(pt->getElementType())) {
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--        inst->setAlignment(g->target->getNativeVectorAlignment());
--#else // LLVM 10.0+
-         inst->setAlignment(llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne());
--#endif
-     }
- 
- #ifdef ISPC_GENX_ENABLED
-@@ -3025,16 +3001,10 @@ void FunctionEmitContext::MemcpyInst(llvm::Value *dest, llvm::Value *src, llvm::
-     }
-     if (align == NULL)
-         align = LLVMInt32(1);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_8_0
--    llvm::Constant *mcFunc =
--        m->module->getOrInsertFunction("llvm.memcpy.p0i8.p0i8.i64", LLVMTypes::VoidType, LLVMTypes::VoidPointerType,
--                                       LLVMTypes::VoidPointerType, LLVMTypes::Int64Type, LLVMTypes::BoolType);
--#else // LLVM 9.0+
-     llvm::FunctionCallee mcFuncCallee =
-         m->module->getOrInsertFunction("llvm.memcpy.p0i8.p0i8.i64", LLVMTypes::VoidType, LLVMTypes::VoidPointerType,
-                                        LLVMTypes::VoidPointerType, LLVMTypes::Int64Type, LLVMTypes::BoolType);
-     llvm::Constant *mcFunc = llvm::cast<llvm::Constant>(mcFuncCallee.getCallee());
--#endif
-     AssertPos(currentPos, mcFunc != NULL);
-     AssertPos(currentPos, llvm::isa<llvm::Function>(mcFunc));
- 
-diff --git a/src/gen/GlobalsLocalization.cpp b/src/gen/GlobalsLocalization.cpp
-index 193a66289..a176e9462 100644
---- a/src/gen/GlobalsLocalization.cpp
-+++ b/src/gen/GlobalsLocalization.cpp
-@@ -470,11 +470,7 @@ void GlobalsLocalization::LocalizeGlobals(LocalizationInfo &LI) {
-         Instruction &FirstI = *Fn->getEntryBlock().begin();
-         Type *ElemTy = GV->getType()->getElementType();
-         AllocaInst *Alloca = new AllocaInst(ElemTy, 0, GV->getName() + ".local", &FirstI);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--        Alloca->setAlignment(GV->getAlignment());
--#else // LLVM 10.0+
-         Alloca->setAlignment(llvm::MaybeAlign(GV->getAlignment()));
--#endif
-         if (!isa<UndefValue>(GV->getInitializer()))
-             new StoreInst(GV->getInitializer(), Alloca, &FirstI);
- 
-diff --git a/src/ispc.cpp b/src/ispc.cpp
-index e2d0f206e..fac5233f7 100644
---- a/src/ispc.cpp
-+++ b/src/ispc.cpp
-@@ -272,9 +272,7 @@ typedef enum {
-     CPU_Silvermont,
- 
-     CPU_ICX,
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     CPU_TGL,
--#endif
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_12_0
-     CPU_ADL,
-     CPU_SPR,
-@@ -365,10 +363,8 @@ class AllCPUs {
- 
-         names[CPU_ICX].push_back("icelake-server");
-         names[CPU_ICX].push_back("icx");
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         names[CPU_TGL].push_back("tigerlake");
-         names[CPU_TGL].push_back("tgl");
--#endif
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_12_0
-         names[CPU_ADL].push_back("alderlake");
-         names[CPU_ADL].push_back("adl");
-@@ -411,11 +407,9 @@ class AllCPUs {
-         compat[CPU_ADL] = Set(CPU_ADL, CPU_x86_64, CPU_Bonnell, CPU_Penryn, CPU_Core2, CPU_Nehalem, CPU_Silvermont,
-                               CPU_SandyBridge, CPU_IvyBridge, CPU_Haswell, CPU_Broadwell, CPU_None);
- #endif
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         compat[CPU_TGL] =
-             Set(CPU_TGL, CPU_x86_64, CPU_Bonnell, CPU_Penryn, CPU_Core2, CPU_Nehalem, CPU_Silvermont, CPU_SandyBridge,
-                 CPU_IvyBridge, CPU_Haswell, CPU_Broadwell, CPU_SKX, CPU_ICL, CPU_ICX, CPU_None);
--#endif
-         compat[CPU_ICX] = Set(CPU_ICX, CPU_x86_64, CPU_Bonnell, CPU_Penryn, CPU_Core2, CPU_Nehalem, CPU_Silvermont,
-                               CPU_SandyBridge, CPU_IvyBridge, CPU_Haswell, CPU_Broadwell, CPU_SKX, CPU_ICL, CPU_None);
- 
-@@ -556,9 +550,7 @@ Target::Target(Arch arch, const char *cpu, ISPCTarget ispc_target, bool pic, boo
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_12_0
-         case CPU_SPR:
- #endif
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         case CPU_TGL:
--#endif
-         case CPU_ICX:
-         case CPU_ICL:
-         case CPU_SKX:
-@@ -916,7 +908,6 @@ Target::Target(Arch arch, const char *cpu, ISPCTarget ispc_target, bool pic, boo
-         }
-         break;
-     case ISPCTarget::avx512skx_i8x64:
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0 // LLVM 10.0+
-         // This target is enabled only for LLVM 10.0 and later
-         // because LLVM requires a number of fixes, which are
-         // committed to LLVM 11.0 and can be applied to 10.0, but not
-@@ -937,12 +928,7 @@ Target::Target(Arch arch, const char *cpu, ISPCTarget ispc_target, bool pic, boo
-         this->m_hasVecPrefetch = false;
-         CPUfromISA = CPU_SKX;
-         break;
--#else
--        unsupported_target = true;
--        break;
--#endif
-     case ISPCTarget::avx512skx_i16x32:
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0 // LLVM 10.0+
-         // This target is enabled only for LLVM 10.0 and later
-         // because LLVM requires a number of fixes, which are
-         // committed to LLVM 11.0 and can be applied to 10.0, but not
-@@ -963,10 +949,6 @@ Target::Target(Arch arch, const char *cpu, ISPCTarget ispc_target, bool pic, boo
-         this->m_hasVecPrefetch = false;
-         CPUfromISA = CPU_SKX;
-         break;
--#else
--        unsupported_target = true;
--        break;
--#endif
- #ifdef ISPC_ARM_ENABLED
-     case ISPCTarget::neon_i8x16:
-         this->m_isa = Target::NEON;
-@@ -1662,11 +1644,9 @@ Globals::Globals() {
-     isMultiTargetCompilation = false;
-     errorLimit = -1;
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     enableTimeTrace = false;
-     // set default granularity to 500.
-     timeTraceGranularity = 500;
--#endif
-     target = NULL;
-     ctx = new llvm::LLVMContext;
- 
-diff --git a/src/ispc.h b/src/ispc.h
-index e25d8830e..de357a21c 100644
---- a/src/ispc.h
-+++ b/src/ispc.h
-@@ -695,13 +695,12 @@ struct Globals {
- 
-     /* Number of errors to show in ISPC. */
-     int errorLimit;
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-+
-     /* When true, enable compile time tracing. */
-     bool enableTimeTrace;
- 
-     /* When compile time tracing is enabled, set time granularity. */
-     int timeTraceGranularity;
--#endif
- };
- 
- enum {
-diff --git a/src/ispc_version.h b/src/ispc_version.h
-index d781347fd..434b2d678 100644
---- a/src/ispc_version.h
-+++ b/src/ispc_version.h
-@@ -44,13 +44,11 @@
- 
- #define ISPC_LLVM_VERSION (LLVM_VERSION_MAJOR * 10000 + LLVM_VERSION_MINOR * 100)
- 
--#define ISPC_LLVM_8_0 80000
--#define ISPC_LLVM_9_0 90000
- #define ISPC_LLVM_10_0 100000
- #define ISPC_LLVM_11_0 110000
- #define ISPC_LLVM_12_0 120000
- 
--#define OLDEST_SUPPORTED_LLVM ISPC_LLVM_8_0
-+#define OLDEST_SUPPORTED_LLVM ISPC_LLVM_10_0
- #define LATEST_SUPPORTED_LLVM ISPC_LLVM_12_0
- 
- #ifdef __ispc__xstr
-diff --git a/src/main.cpp b/src/main.cpp
-index 8f64330cc..5c920eabc 100644
---- a/src/main.cpp
-+++ b/src/main.cpp
-@@ -55,9 +55,7 @@
- #include <llvm/Support/Signals.h>
- #include <llvm/Support/TargetRegistry.h>
- #include <llvm/Support/TargetSelect.h>
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
- #include <llvm/Support/ToolOutputFile.h>
--#endif
- 
- #ifdef ISPC_HOST_IS_WINDOWS
- #define strcasecmp stricmp
-@@ -181,11 +179,9 @@ static void lPrintVersion() {
-     snprintf(targetHelp, sizeof(targetHelp), "[--target-os=<os>]\t\t\tSelect target OS.  <os>={%s}",
-              g->target_registry->getSupportedOSes().c_str());
-     PrintWithWordBreaks(targetHelp, 24, TerminalWidth(), stdout);
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     printf("    [--time-trace]\t\t\tTurn on time profiler. Generates JSON file based on output filename.\n");
-     printf("    [--time-trace-granularity=<value>\tMinimum time granularity (in microseconds) traced by time "
-            "profiler.\n");
--#endif
-     printf("    [--version]\t\t\t\tPrint ispc version\n");
- #ifdef ISPC_GENX_ENABLED
-     printf("    [--vc-options=<\"-option1 -option2...\">]\t\t\t\tPass additional options to Vector Compiler backend\n");
-@@ -462,7 +458,6 @@ static void setCallingConv(VectorCallStatus vectorCall, Arch arch) {
-     }
- }
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
- static void writeCompileTimeFile(const char *outFileName) {
-     llvm::SmallString<128> jsonFileName(outFileName);
-     jsonFileName.append(".json");
-@@ -479,7 +474,6 @@ static void writeCompileTimeFile(const char *outFileName) {
-     of->keep();
-     return;
- }
--#endif
- 
- static std::set<int> ParsingPhases(char *stages, ArgErrors &errorHandler) {
-     constexpr int parsing_limit = 100;
-@@ -791,12 +785,10 @@ int main(int Argc, char *Argv[]) {
-             }
-         } else if (!strncmp(argv[i], "--force-alignment=", 18)) {
-             g->forceAlignment = atoi(argv[i] + 18);
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         } else if (!strcmp(argv[i], "--time-trace")) {
-             g->enableTimeTrace = true;
-         } else if (!strncmp(argv[i], "--time-trace-granularity=", 25)) {
-             g->timeTraceGranularity = atoi(argv[i] + 25);
--#endif
-         } else if (!strcmp(argv[i], "--woff") || !strcmp(argv[i], "-woff")) {
-             g->disableWarnings = true;
-             g->emitPerfWarnings = false;
-@@ -1059,7 +1051,6 @@ int main(int Argc, char *Argv[]) {
- 
-     // This needs to happen after the TargetOS is decided.
-     setCallingConv(vectorCall, arch);
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     if (g->enableTimeTrace) {
-         llvm::timeTraceProfilerInitialize(g->timeTraceGranularity, "ispc");
-     }
-@@ -1077,9 +1068,5 @@ int main(int Argc, char *Argv[]) {
-         }
-         llvm::timeTraceProfilerCleanup();
-     }
--#else
--    int ret = Module::CompileAndOutput(file, arch, cpu, targets, flags, ot, outFileName, headerFileName, depsFileName,
--                                       depsTargetName, hostStubFileName, devStubFileName);
--#endif
-     return ret;
- }
-diff --git a/src/module.cpp b/src/module.cpp
-index fe7452df1..a85fec77a 100644
---- a/src/module.cpp
-+++ b/src/module.cpp
-@@ -170,9 +170,7 @@ Module::Module(const char *fn) {
-     module->setDataLayout(g->target->getDataLayout()->getStringRepresentation());
- 
-     if (g->generateDebuggingSymbols) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         llvm::TimeTraceScope TimeScope("Create Debug Data");
--#endif
-         // To enable debug information on Windows, we have to let llvm know, that
-         // debug information should be emitted in CodeView format.
-         if (g->target_os == TargetOS::windows) {
-@@ -226,10 +224,8 @@ extern YY_BUFFER_STATE yy_create_buffer(FILE *, int);
- extern void yy_delete_buffer(YY_BUFFER_STATE);
- 
- int Module::CompileFile() {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope CompileFileTimeScope(
-         "CompileFile", llvm::StringRef(filename + ("_" + std::string(g->target->GetISAString()))));
--#endif
-     extern void ParserInit();
-     ParserInit();
- 
-@@ -238,18 +234,14 @@ int Module::CompileFile() {
-     // variable 'm' to be initialized and available (which it isn't until
-     // the Module constructor returns...)
-     {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         llvm::TimeTraceScope TimeScope("DefineStdlib");
--#endif
-         DefineStdlib(symbolTable, g->ctx, module, g->includeStdlib);
-     }
- 
-     bool runPreprocessor = g->runCPP;
- 
-     if (runPreprocessor) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         llvm::TimeTraceScope TimeScope("Frontend parser");
--#endif
-         if (!IsStdin(filename)) {
-             // Try to open the file first, since otherwise we crash in the
-             // preprocessor if the file doesn't exist.
-@@ -268,9 +260,7 @@ int Module::CompileFile() {
-         yyparse();
-         yy_delete_buffer(strbuf);
-     } else {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         llvm::TimeTraceScope TimeScope("Frontend parser");
--#endif
-         // No preprocessor, just open up the file if it's not stdin..
-         FILE *f = NULL;
-         if (IsStdin(filename)) {
-@@ -297,9 +287,7 @@ int Module::CompileFile() {
- 
-     if (diBuilder)
-         diBuilder->finalize();
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope TimeScope("Optimize");
--#endif
-     if (errorCount == 0)
-         Optimize(module, g->opt.level);
- 
-@@ -1243,15 +1231,8 @@ bool Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, llvm:
-                                        const char *outFileName) {
-     // Figure out if we're generating object file or assembly output, and
-     // set binary output for object files
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--    Assert(!g->target->isGenXTarget());
--    llvm::TargetMachine::CodeGenFileType fileType =
--        (outputType == Object) ? llvm::TargetMachine::CGFT_ObjectFile : llvm::TargetMachine::CGFT_AssemblyFile;
--    bool binary = (fileType == llvm::TargetMachine::CGFT_ObjectFile);
--#else // LLVM 10.0+
-     llvm::CodeGenFileType fileType = (outputType == Object) ? llvm::CGFT_ObjectFile : llvm::CGFT_AssemblyFile;
-     bool binary = (fileType == llvm::CGFT_ObjectFile);
--#endif
- 
-     llvm::sys::fs::OpenFlags flags = binary ? llvm::sys::fs::F_None : llvm::sys::fs::F_Text;
- 
-@@ -2219,11 +2200,7 @@ void Module::execPreprocessor(const char *infilename, llvm::raw_string_ostream *
-     inst.setTarget(target);
-     inst.createSourceManager(inst.getFileManager());
- 
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--    clang::FrontendInputFile inputFile(infilename, clang::InputKind::Unknown);
--#else // LLVM 10.0+
-     clang::FrontendInputFile inputFile(infilename, clang::InputKind());
--#endif
- 
-     inst.InitializeSourceManager(inputFile);
- 
-@@ -2722,9 +2699,7 @@ int Module::CompileAndOutput(const char *srcFile, Arch arch, const char *cpu, st
- 
-         m = new Module(srcFile);
-         if (m->CompileFile() == 0) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-             llvm::TimeTraceScope TimeScope("Backend");
--#endif
- #ifdef ISPC_GENX_ENABLED
-             if (outputType == Asm || outputType == Object) {
-                 if (g->target->isGenXTarget()) {
-@@ -2855,9 +2830,7 @@ int Module::CompileAndOutput(const char *srcFile, Arch arch, const char *cpu, st
- 
-             m = new Module(srcFile);
-             int compileFileError = m->CompileFile();
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-             llvm::TimeTraceScope TimeScope("Backend");
--#endif
-             if (compileFileError == 0) {
-                 // Create the dispatch module, unless already created;
-                 // in the latter case, just do the checking
-diff --git a/src/module.h b/src/module.h
-index 61d3cfea0..603124d50 100644
---- a/src/module.h
-+++ b/src/module.h
-@@ -43,9 +43,7 @@
- 
- #include <llvm/IR/DebugInfo.h>
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
- #include <llvm/Support/TimeProfiler.h>
--#endif
- 
- #ifdef ISPC_GENX_ENABLED
- #include "ocl_igc_interface/igc_ocl_device_ctx.h"
-diff --git a/src/opt.cpp b/src/opt.cpp
-index a655a8344..5b1ac7b63 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -66,6 +66,7 @@
- #include <llvm/IR/Instructions.h>
- #include <llvm/IR/IntrinsicInst.h>
- #include <llvm/IR/Intrinsics.h>
-+#include <llvm/IR/IntrinsicsX86.h>
- #include <llvm/IR/LegacyPassManager.h>
- #include <llvm/IR/Module.h>
- #include <llvm/IR/PatternMatch.h>
-@@ -85,9 +86,6 @@
- #include <llvm/Transforms/Scalar/InstSimplifyPass.h>
- #include <llvm/Transforms/Utils.h>
- #include <llvm/Transforms/Utils/BasicBlockUtils.h>
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
--#include <llvm/IR/IntrinsicsX86.h>
--#endif
- 
- #ifdef ISPC_HOST_IS_LINUX
- #include <alloca.h>
-@@ -1003,10 +1001,7 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 else
-                     align = callInst->getCalledFunction() == avxMaskedLoad32 ? 4 : 8;
-                 name = LLVMGetName(callInst->getArgOperand(0), "_load");
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                llvm::Instruction *loadInst =
--                    new llvm::LoadInst(castPtr, name, false /* not volatile */, align, (llvm::Instruction *)NULL);
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-                 llvm::Instruction *loadInst = new llvm::LoadInst(castPtr, name, false /* not volatile */,
-                                                                  llvm::MaybeAlign(align), (llvm::Instruction *)NULL);
- #else
-@@ -1043,13 +1038,8 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                     align = g->target->getNativeVectorAlignment();
-                 else
-                     align = callInst->getCalledFunction() == avxMaskedStore32 ? 4 : 8;
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                llvm::StoreInst *storeInst = new llvm::StoreInst(rvalue, castPtr, (llvm::Instruction *)NULL);
--                storeInst->setAlignment(align);
--#else
-                 llvm::StoreInst *storeInst = new llvm::StoreInst(rvalue, castPtr, (llvm::Instruction *)NULL,
-                                                                  llvm::MaybeAlign(align).valueOrOne());
--#endif
-                 lCopyMetadata(storeInst, callInst);
-                 llvm::ReplaceInstWithInst(callInst, storeInst);
- 
-@@ -1066,9 +1056,7 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool IntrinsicsOpt::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("IntrinsicsOpt::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -1239,9 +1227,7 @@ bool InstructionSimplifyPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool InstructionSimplifyPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("InstructionSimplifyPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -2974,16 +2960,10 @@ static bool lImproveMaskedStore(llvm::CallInst *callInst) {
- 
-             lvalue = new llvm::BitCastInst(lvalue, ptrType, "lvalue_to_ptr_type", callInst);
-             lCopyMetadata(lvalue, callInst);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--            store =
--                new llvm::StoreInst(rvalue, lvalue, false /* not volatile */,
--                                    g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align);
--#else
-             store = new llvm::StoreInst(
-                 rvalue, lvalue, false /* not volatile */,
-                 llvm::MaybeAlign(g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align)
-                     .valueOrOne());
--#endif
-         }
-         if (store != NULL) {
-             lCopyMetadata(store, callInst);
-@@ -3059,11 +3039,7 @@ static bool lImproveMaskedLoad(llvm::CallInst *callInst, llvm::BasicBlock::itera
-         {
-             llvm::Type *ptrType = llvm::PointerType::get(callInst->getType(), 0);
-             ptr = new llvm::BitCastInst(ptr, ptrType, "ptr_cast_for_load", callInst);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--            load = new llvm::LoadInst(ptr, callInst->getName(), false /* not volatile */,
--                                      g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align,
--                                      (llvm::Instruction *)NULL);
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-             load = new llvm::LoadInst(
-                 ptr, callInst->getName(), false /* not volatile */,
-                 llvm::MaybeAlign(g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align)
-@@ -3129,9 +3105,7 @@ bool ImproveMemoryOpsPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ImproveMemoryOpsPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ImproveMemoryOpsPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -3424,9 +3398,7 @@ llvm::Value *lGEPAndLoad(llvm::Value *basePtr, int64_t offset, int align, llvm::
-                          llvm::Type *type) {
-     llvm::Value *ptr = lGEPInst(basePtr, LLVMInt64(offset), "new_base", insertBefore);
-     ptr = new llvm::BitCastInst(ptr, llvm::PointerType::get(type, 0), "ptr_cast", insertBefore);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--    return new llvm::LoadInst(ptr, "gather_load", false /* not volatile */, align, insertBefore);
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-     return new llvm::LoadInst(ptr, "gather_load", false /* not volatile */, llvm::MaybeAlign(align), insertBefore);
- #else // LLVM 11.0+
-     return new llvm::LoadInst(llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(), ptr,
-@@ -4135,9 +4107,7 @@ bool GatherCoalescePass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool GatherCoalescePass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("GatherCoalescePass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -4467,9 +4437,7 @@ bool ReplacePseudoMemoryOpsPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ReplacePseudoMemoryOpsPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ReplacePseudoMemoryOpsPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -4573,9 +4541,7 @@ bool IsCompileTimeConstantPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool IsCompileTimeConstantPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("IsCompileTimeConstantPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -5201,9 +5167,7 @@ bool PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool PeepholePass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("PeepholePass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -5299,9 +5263,7 @@ bool ReplaceStdlibShiftPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ReplaceStdlibShiftPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ReplaceStdlibShiftPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -5399,9 +5361,7 @@ llvm::Instruction *FixBooleanSelectPass::fixSelect(llvm::SelectInst *sel, llvm::
- }
- 
- bool FixBooleanSelectPass::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("FixBooleanSelectPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
- 
-     return modifiedAny;
-@@ -5964,9 +5924,7 @@ bool GenXGatherCoalescing::runOnBasicBlock(llvm::BasicBlock &bb) {
- }
- 
- bool GenXGatherCoalescing::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("GenXGatherCoalescing::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6113,9 +6071,7 @@ bool PromoteToPrivateMemoryPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool PromoteToPrivateMemoryPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("PromoteToPrivateMemoryPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6181,9 +6137,7 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ReplaceLLVMIntrinsics::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ReplaceLLVMIntrinsics::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6278,9 +6232,7 @@ bool ReplaceUnsupportedInsts::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ReplaceUnsupportedInsts::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ReplaceUnsupportedInsts::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6369,9 +6321,7 @@ bool CheckUnsupportedInsts::runOnBasicBlock(llvm::BasicBlock &bb) {
- }
- 
- bool CheckUnsupportedInsts::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("CheckUnsupportedInsts::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6440,9 +6390,7 @@ bool MangleOpenCLBuiltins::runOnBasicBlock(llvm::BasicBlock &bb) {
- }
- 
- bool MangleOpenCLBuiltins::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("MangleOpenCLBuiltins::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6828,9 +6776,7 @@ bool FixAddressSpace::runOnFunction(llvm::Function &F) {
-     // Transformations are correct when the function is not internal.
-     // This is due to address space calculation algorithm.
-     // TODO: problems can be met in case of Stack Calls
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("FixAddressSpace::runOnFunction", F.getName());
--#endif
-     if (F.getLinkage() == llvm::GlobalValue::LinkageTypes::InternalLinkage)
-         return false;
- 
-@@ -6854,9 +6800,7 @@ class DemotePHIs : public llvm::FunctionPass {
- char DemotePHIs::ID = 0;
- 
- bool DemotePHIs::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("DemotePHIs::runOnFunction", F.getName());
--#endif
-     if (F.isDeclaration() || skipFunction(F))
-         return false;
-     std::vector<llvm::Instruction *> WorkList;
-diff --git a/src/type.cpp b/src/type.cpp
-index 688a4e874..fa0cb04db 100644
---- a/src/type.cpp
-+++ b/src/type.cpp
-@@ -1822,14 +1822,10 @@ llvm::DIType *StructType::GetDIType(llvm::DIScope *scope) const {
-     llvm::DIFile *diFile = pos.GetDIFile();
-     llvm::DINamespace *diSpace = pos.GetDINamespace();
-     return m->diBuilder->createStructType(diSpace, GetString(), diFile,
--                                          pos.first_line,          // Line number
--                                          layout->getSizeInBits(), // Size in bits
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                                          layout->getAlignment() * 8, // Alignment in bits
--#else                                                                 // LLVM 10.0+
-+                                          pos.first_line,                     // Line number
-+                                          layout->getSizeInBits(),            // Size in bits
-                                           layout->getAlignment().value() * 8, // Alignment in bits
--#endif
--                                          llvm::DINode::FlagZero, // Flags
-+                                          llvm::DINode::FlagZero,             // Flags
-                                           NULL, elements);
- }
- 
-diff --git a/tests/lit-tests/1771.ispc b/tests/lit-tests/1771.ispc
-index 98064d84d..4feb73dd7 100644
---- a/tests/lit-tests/1771.ispc
-+++ b/tests/lit-tests/1771.ispc
-@@ -5,7 +5,6 @@
- // RUN: %{ispc} %s --target=sse4-i16x8 --emit-asm -o - | FileCheck %s -check-prefix=CHECKSSE4_I16X8
- // RUN: %{ispc} %s --target=sse4-i8x16 --emit-asm -o - | FileCheck %s -check-prefix=CHECKSSE4_I8X16
- 
--// REQUIRES: LLVM_10_0+
- // REQUIRES: X86_ENABLED
- 
- // CHECKAVX2_I32X8: {{[a-z]*xor[a-z]*}}  %xmm0, %xmm0, %xmm0
-diff --git a/tests/lit-tests/1844.ispc b/tests/lit-tests/1844.ispc
-index 793a8866c..189edf4c3 100644
---- a/tests/lit-tests/1844.ispc
-+++ b/tests/lit-tests/1844.ispc
-@@ -6,9 +6,6 @@
- 
- // REQUIRES: X86_ENABLED
- 
--// It doesn't work for anything earlier than 10.0, but it will not be fixed, so don't run.
--// REQUIRES: LLVM_10_0+
--
- extern uniform unsigned int64 var_6;
- extern uniform unsigned int16 var_11;
- extern uniform bool arr_201 [1] [15] [20];
-diff --git a/tests/lit-tests/1926.ispc b/tests/lit-tests/1926.ispc
-index 70f7cc3c2..7921c91a6 100644
---- a/tests/lit-tests/1926.ispc
-+++ b/tests/lit-tests/1926.ispc
-@@ -2,8 +2,6 @@
- // RUN: cat %T/1926.o.json \
- // RUN:   | FileCheck %s
- 
--// REQUIRES: LLVM_10_0+
--
- // CHECK: "traceEvents"
- // CHECK: "detail"
- export uniform int foo(uniform int a[], uniform int count) {
-diff --git a/tests/lit-tests/cpus_x86.ispc b/tests/lit-tests/cpus_x86.ispc
-index 516efdd4c..4d60186f6 100644
---- a/tests/lit-tests/cpus_x86.ispc
-+++ b/tests/lit-tests/cpus_x86.ispc
-@@ -24,6 +24,8 @@
- //; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=icl
- //; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=icelake-server
- //; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=icx
-+//; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=tigerlake
-+//; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=tgl
- 
- // REQUIRES: X86_ENABLED
- 
-diff --git a/tests/lit-tests/cpus_x86_llvm10.ispc b/tests/lit-tests/cpus_x86_llvm10.ispc
-deleted file mode 100644
-index ef00000e5..000000000
---- a/tests/lit-tests/cpus_x86_llvm10.ispc
-+++ /dev/null
-@@ -1,11 +0,0 @@
--// The test checks that cpu definitions (including all synonyms) are successfully consumed by compiler.
--
--//; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=tigerlake
--//; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=tgl
--
--// REQUIRES: X86_ENABLED
--// REQUIRES: LLVM_10_0+
--
--uniform int i;
--
--void foo() {}
-diff --git a/tests/lit-tests/lit.cfg b/tests/lit-tests/lit.cfg
-index 17016579d..045e69437 100644
---- a/tests/lit-tests/lit.cfg
-+++ b/tests/lit-tests/lit.cfg
-@@ -30,11 +30,6 @@ print("Config:")
- 
- # LLVM version
- llvm_version = LooseVersion(ispc_llvm_version_number)
--if llvm_version >= LooseVersion("10.0.0"):
--    print("LLVM_10_0+: YES")
--    config.available_features.add("LLVM_10_0+")
--else:
--    print("LLVM_10_0+: NO")
- 
- if llvm_version >= LooseVersion("12.0.0"):
-     print("LLVM_12_0+: YES")
diff --git a/srcpkgs/ispc/patches/llvm12-003.patch b/srcpkgs/ispc/patches/llvm12-003.patch
deleted file mode 100644
index 0423afc9e3f9..000000000000
--- a/srcpkgs/ispc/patches/llvm12-003.patch
+++ /dev/null
@@ -1,1504 +0,0 @@
-From 1851d18b213dbad169937076176b2d5509733c76 Mon Sep 17 00:00:00 2001
-From: Deepak Rajendrakumaran <deepak.rajendrakumaran@intel.com>
-Date: Tue, 12 Jan 2021 22:15:12 -0800
-Subject: [PATCH] fixes #1821 - Removing LLVMGetName() and switching to
- LLVM::Twine.
-
----
- src/ctx.cpp      | 304 ++++++++++++++++++++++-------------------------
- src/ctx.h        |  72 +++++------
- src/expr.cpp     |  36 +++---
- src/llvmutil.cpp |  17 ---
- src/llvmutil.h   |   5 -
- src/opt.cpp      | 103 +++++++++-------
- 6 files changed, 255 insertions(+), 282 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 42c4ea09d..ded524b71 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1020,8 +1020,8 @@ void FunctionEmitContext::EmitCaseLabel(int value, bool checkMask, SourcePos pos
-     llvm::BasicBlock *bbCaseImpl = NULL;
-     if (emitGenXHardwareMask()) {
-         // Create basic block with actual case implementation
--        std::string bbName = bbCase->getName().str() + "_impl";
--        bbCaseImpl = CreateBasicBlock(bbName.c_str(), bbCase);
-+        llvm::Twine bbName = llvm::Twine(bbCase->getName()) + "_impl";
-+        bbCaseImpl = CreateBasicBlock(bbName, bbCase);
-     }
- #endif
- 
-@@ -1185,7 +1185,7 @@ bool FunctionEmitContext::initLabelBBlocks(ASTNode *node, void *data) {
-     if (ctx->labelMap.find(ls->name) != ctx->labelMap.end())
-         Error(ls->pos, "Multiple labels named \"%s\" in function.", ls->name.c_str());
-     else {
--        llvm::BasicBlock *bb = ctx->CreateBasicBlock(ls->name.c_str());
-+        llvm::BasicBlock *bb = ctx->CreateBasicBlock(ls->name);
-         ctx->labelMap[ls->name] = bb;
-     }
-     return true;
-@@ -1299,7 +1299,7 @@ llvm::Value *FunctionEmitContext::Any(llvm::Value *mask) {
-     // We can actually call either one, since both are i32s as far as
-     // LLVM's type system is concerned...
-     llvm::Function *fmm = mm[0]->function;
--    return CallInst(fmm, NULL, mask, LLVMGetName(mask, "_any"));
-+    return CallInst(fmm, NULL, mask, llvm::Twine(mask->getName()) + "_any");
- }
- 
- llvm::Value *FunctionEmitContext::All(llvm::Value *mask) {
-@@ -1315,7 +1315,7 @@ llvm::Value *FunctionEmitContext::All(llvm::Value *mask) {
-     // We can actually call either one, since both are i32s as far as
-     // LLVM's type system is concerned...
-     llvm::Function *fmm = mm[0]->function;
--    return CallInst(fmm, NULL, mask, LLVMGetName(mask, "_all"));
-+    return CallInst(fmm, NULL, mask, llvm::Twine(mask->getName()) + "_all");
- }
- 
- llvm::Value *FunctionEmitContext::None(llvm::Value *mask) {
-@@ -1331,7 +1331,7 @@ llvm::Value *FunctionEmitContext::None(llvm::Value *mask) {
-     // We can actually call either one, since both are i32s as far as
-     // LLVM's type system is concerned...
-     llvm::Function *fmm = mm[0]->function;
--    return CallInst(fmm, NULL, mask, LLVMGetName(mask, "_none"));
-+    return CallInst(fmm, NULL, mask, llvm::Twine(mask->getName()) + "_none");
- }
- 
- llvm::Value *FunctionEmitContext::LaneMask(llvm::Value *v) {
-@@ -1349,7 +1349,7 @@ llvm::Value *FunctionEmitContext::LaneMask(llvm::Value *v) {
-     // We can actually call either one, since both are i32s as far as
-     // LLVM's type system is concerned...
-     llvm::Function *fmm = mm[0]->function;
--    return CallInst(fmm, NULL, v, LLVMGetName(v, "_movmsk"));
-+    return CallInst(fmm, NULL, v, llvm::Twine(v->getName()) + "_movmsk");
- }
- 
- llvm::Value *FunctionEmitContext::MasksAllEqual(llvm::Value *v1, llvm::Value *v2) {
-@@ -1364,11 +1364,12 @@ llvm::Value *FunctionEmitContext::MasksAllEqual(llvm::Value *v1, llvm::Value *v2
- #else
-     if (g->target->getArch() == Arch::wasm32) {
-         llvm::Function *fmm = m->module->getFunction("__wasm_cmp_msk_eq");
--        return CallInst(fmm, NULL, {v1, v2}, LLVMGetName("wasm_cmp_msk_eq", v1, v2));
-+        return CallInst(fmm, NULL, {v1, v2}, ((llvm::Twine("wasm_cmp_msk_eq_") + v1->getName()) + "_") + v2->getName());
-     }
-     llvm::Value *mm1 = LaneMask(v1);
-     llvm::Value *mm2 = LaneMask(v2);
--    return CmpInst(llvm::Instruction::ICmp, llvm::CmpInst::ICMP_EQ, mm1, mm2, LLVMGetName("equal", v1, v2));
-+    return CmpInst(llvm::Instruction::ICmp, llvm::CmpInst::ICMP_EQ, mm1, mm2,
-+                   ((llvm::Twine("equal_") + v1->getName()) + "_") + v2->getName());
- #endif
- }
- 
-@@ -1392,7 +1393,7 @@ llvm::Value *FunctionEmitContext::GetStringPtr(const std::string &str) {
-     return new llvm::BitCastInst(lstrPtr, LLVMTypes::VoidPointerType, "str_void_ptr", bblock);
- }
- 
--llvm::BasicBlock *FunctionEmitContext::CreateBasicBlock(const char *name, llvm::BasicBlock *insertAfter) {
-+llvm::BasicBlock *FunctionEmitContext::CreateBasicBlock(const llvm::Twine &name, llvm::BasicBlock *insertAfter) {
-     llvm::BasicBlock *newBB = llvm::BasicBlock::Create(*g->ctx, name, llvmFunction);
-     if (insertAfter)
-         newBB->moveAfter(insertAfter);
-@@ -1416,14 +1417,15 @@ llvm::Value *FunctionEmitContext::I1VecToBoolVec(llvm::Value *b) {
- 
-         for (unsigned int i = 0; i < at->getNumElements(); ++i) {
-             llvm::Value *elt = ExtractInst(b, i);
--            llvm::Value *sext = SwitchBoolSize(elt, LLVMTypes::BoolVectorStorageType, LLVMGetName(elt, "_to_boolvec"));
-+            llvm::Value *sext =
-+                SwitchBoolSize(elt, LLVMTypes::BoolVectorStorageType, llvm::Twine(elt->getName()) + "_to_boolvec");
-             ret = InsertInst(ret, sext, i);
-         }
-         return ret;
-     } else {
-         // For non-array types, convert to 'LLVMTypes::BoolVectorType' if
-         // necessary.
--        return SwitchBoolSize(b, LLVMTypes::BoolVectorType, LLVMGetName(b, "_to_boolvec"));
-+        return SwitchBoolSize(b, LLVMTypes::BoolVectorType, llvm::Twine(b->getName()) + "_to_boolvec");
-     }
- }
- 
-@@ -1563,7 +1565,7 @@ static int lArrayVectorWidth(llvm::Type *t) {
- }
- 
- llvm::Value *FunctionEmitContext::BinaryOperator(llvm::Instruction::BinaryOps inst, llvm::Value *v0, llvm::Value *v1,
--                                                 const char *name) {
-+                                                 const llvm::Twine &name) {
-     if (v0 == NULL || v1 == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1573,7 +1575,7 @@ llvm::Value *FunctionEmitContext::BinaryOperator(llvm::Instruction::BinaryOps in
-     llvm::Type *type = v0->getType();
-     int arraySize = lArrayVectorWidth(type);
-     if (arraySize == 0) {
--        llvm::Instruction *bop = llvm::BinaryOperator::Create(inst, v0, v1, name ? name : "", bblock);
-+        llvm::Instruction *bop = llvm::BinaryOperator::Create(inst, v0, v1, name, bblock);
-         AddDebugPos(bop);
-         return bop;
-     } else {
-@@ -1591,7 +1593,7 @@ llvm::Value *FunctionEmitContext::BinaryOperator(llvm::Instruction::BinaryOps in
-     }
- }
- 
--llvm::Value *FunctionEmitContext::NotOperator(llvm::Value *v, const char *name) {
-+llvm::Value *FunctionEmitContext::NotOperator(llvm::Value *v, const llvm::Twine &name) {
-     if (v == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1603,14 +1605,14 @@ llvm::Value *FunctionEmitContext::NotOperator(llvm::Value *v, const char *name)
-     llvm::Type *type = v->getType();
-     int arraySize = lArrayVectorWidth(type);
-     if (arraySize == 0) {
--        llvm::Instruction *binst = llvm::BinaryOperator::CreateNot(v, name ? name : "not", bblock);
-+        llvm::Instruction *binst = llvm::BinaryOperator::CreateNot(v, name.isTriviallyEmpty() ? "not" : name, bblock);
-         AddDebugPos(binst);
-         return binst;
-     } else {
-         llvm::Value *ret = llvm::UndefValue::get(type);
-         for (int i = 0; i < arraySize; ++i) {
-             llvm::Value *a = ExtractInst(v, i);
--            llvm::Value *op = llvm::BinaryOperator::CreateNot(a, name ? name : "not", bblock);
-+            llvm::Value *op = llvm::BinaryOperator::CreateNot(a, name.isTriviallyEmpty() ? "not" : name, bblock);
-             AddDebugPos(op);
-             ret = InsertInst(ret, op, i);
-         }
-@@ -1638,7 +1640,7 @@ static llvm::Type *lGetMatchingBoolVectorType(llvm::Type *type) {
- }
- 
- llvm::Value *FunctionEmitContext::CmpInst(llvm::Instruction::OtherOps inst, llvm::CmpInst::Predicate pred,
--                                          llvm::Value *v0, llvm::Value *v1, const char *name) {
-+                                          llvm::Value *v0, llvm::Value *v1, const llvm::Twine &name) {
-     if (v0 == NULL || v1 == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1648,7 +1650,8 @@ llvm::Value *FunctionEmitContext::CmpInst(llvm::Instruction::OtherOps inst, llvm
-     llvm::Type *type = v0->getType();
-     int arraySize = lArrayVectorWidth(type);
-     if (arraySize == 0) {
--        llvm::Instruction *ci = llvm::CmpInst::Create(inst, pred, v0, v1, name ? name : "cmp", bblock);
-+        llvm::Instruction *ci =
-+            llvm::CmpInst::Create(inst, pred, v0, v1, name.isTriviallyEmpty() ? "cmp" : name, bblock);
-         AddDebugPos(ci);
-         return ci;
-     } else {
-@@ -1657,14 +1660,14 @@ llvm::Value *FunctionEmitContext::CmpInst(llvm::Instruction::OtherOps inst, llvm
-         for (int i = 0; i < arraySize; ++i) {
-             llvm::Value *a = ExtractInst(v0, i);
-             llvm::Value *b = ExtractInst(v1, i);
--            llvm::Value *op = CmpInst(inst, pred, a, b, name);
-+            llvm::Value *op = CmpInst(inst, pred, a, b, name.isTriviallyEmpty() ? "cmp" : name);
-             ret = InsertInst(ret, op, i);
-         }
-         return ret;
-     }
- }
- 
--llvm::Value *FunctionEmitContext::SmearUniform(llvm::Value *value, const char *name) {
-+llvm::Value *FunctionEmitContext::SmearUniform(llvm::Value *value, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1704,21 +1707,19 @@ llvm::Value *FunctionEmitContext::SmearUniform(llvm::Value *value, const char *n
-     return ret;
- }
- 
--llvm::Value *FunctionEmitContext::BitCastInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Value *FunctionEmitContext::BitCastInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_bitcast");
--
--    llvm::Instruction *inst = new llvm::BitCastInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::BitCastInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_bitcast" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, const char *name) {
-+llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1728,23 +1729,19 @@ llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, const char *n
-         // no-op for varying pointers; they're already vectors of ints
-         return value;
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_ptr2int");
-     llvm::Type *type = LLVMTypes::PointerIntType;
--    llvm::Instruction *inst = new llvm::PtrToIntInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::PtrToIntInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_ptr2int" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, llvm::Type *toType, const char *name) {
-+llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, llvm::Type *toType, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_ptr2int");
--
-     llvm::Type *fromType = value->getType();
-     if (llvm::isa<llvm::VectorType>(fromType)) {
-         // varying pointer
-@@ -1752,27 +1749,26 @@ llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, llvm::Type *t
-             // already the right type--done
-             return value;
-         else if (fromType->getScalarSizeInBits() > toType->getScalarSizeInBits())
--            return TruncInst(value, toType, name);
-+            return TruncInst(value, toType,
-+                             name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_ptr2int" : name);
-         else {
-             AssertPos(currentPos, fromType->getScalarSizeInBits() < toType->getScalarSizeInBits());
--            return ZExtInst(value, toType, name);
-+            return ZExtInst(value, toType, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_ptr2int" : name);
-         }
-     }
- 
--    llvm::Instruction *inst = new llvm::PtrToIntInst(value, toType, name, bblock);
-+    llvm::Instruction *inst = new llvm::PtrToIntInst(
-+        value, toType, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_ptr2int" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Value *FunctionEmitContext::IntToPtrInst(llvm::Value *value, llvm::Type *toType, const char *name) {
-+llvm::Value *FunctionEmitContext::IntToPtrInst(llvm::Value *value, llvm::Type *toType, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_int2ptr");
--
-     llvm::Type *fromType = value->getType();
-     if (llvm::isa<llvm::VectorType>(fromType)) {
-         // varying pointer
-@@ -1780,95 +1776,87 @@ llvm::Value *FunctionEmitContext::IntToPtrInst(llvm::Value *value, llvm::Type *t
-             // done
-             return value;
-         else if (fromType->getScalarSizeInBits() > toType->getScalarSizeInBits())
--            return TruncInst(value, toType, name);
-+            return TruncInst(value, toType,
-+                             name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_int2ptr" : name);
-         else {
-             AssertPos(currentPos, fromType->getScalarSizeInBits() < toType->getScalarSizeInBits());
--            return ZExtInst(value, toType, name);
-+            return ZExtInst(value, toType, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_int2ptr" : name);
-         }
-     }
- 
--    llvm::Instruction *inst = new llvm::IntToPtrInst(value, toType, name, bblock);
-+    llvm::Instruction *inst = new llvm::IntToPtrInst(
-+        value, toType, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_int2ptr" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Instruction *FunctionEmitContext::TruncInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Instruction *FunctionEmitContext::TruncInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_trunc");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = new llvm::TruncInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::TruncInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_trunc" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
- llvm::Instruction *FunctionEmitContext::CastInst(llvm::Instruction::CastOps op, llvm::Value *value, llvm::Type *type,
--                                                 const char *name) {
-+                                                 const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_cast");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = llvm::CastInst::Create(op, value, type, name, bblock);
-+    llvm::Instruction *inst = llvm::CastInst::Create(
-+        op, value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_cast" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Instruction *FunctionEmitContext::FPCastInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Instruction *FunctionEmitContext::FPCastInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_cast");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = llvm::CastInst::CreateFPCast(value, type, name, bblock);
-+    llvm::Instruction *inst = llvm::CastInst::CreateFPCast(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_cast" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Instruction *FunctionEmitContext::SExtInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Instruction *FunctionEmitContext::SExtInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_sext");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = new llvm::SExtInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::SExtInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_sext" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Instruction *FunctionEmitContext::ZExtInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Instruction *FunctionEmitContext::ZExtInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_zext");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = new llvm::ZExtInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::ZExtInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_zext" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
-@@ -1913,14 +1901,15 @@ llvm::Value *FunctionEmitContext::applyVaryingGEP(llvm::Value *basePtr, llvm::Va
-         scale = SmearUniform(scale);
-         Assert(index != NULL);
-         // offset = index * scale
--        offset = BinaryOperator(llvm::Instruction::Mul, scale, index, LLVMGetName("mul", scale, index));
-+        offset = BinaryOperator(llvm::Instruction::Mul, scale, index,
-+                                ((llvm::Twine("mul_") + scale->getName()) + "_") + index->getName());
-     }
- 
-     // For 64-bit targets, if we've been doing our offset calculations in
-     // 32 bits, we still have to convert to a 64-bit value before we
-     // actually add the offset to the pointer.
-     if (g->target->is32Bit() == false && g->opt.force32BitAddressing == true)
--        offset = SExtInst(offset, LLVMTypes::Int64VectorType, LLVMGetName(offset, "_to_64"));
-+        offset = SExtInst(offset, LLVMTypes::Int64VectorType, llvm::Twine(offset->getName()) + "_to_64");
- 
-     // Smear out the pointer to be varying; either the base pointer or the
-     // index must be varying for this method to be called.
-@@ -1929,7 +1918,7 @@ llvm::Value *FunctionEmitContext::applyVaryingGEP(llvm::Value *basePtr, llvm::Va
-     llvm::Value *varyingPtr = baseIsUniform ? SmearUniform(basePtr) : basePtr;
- 
-     // newPtr = ptr + offset
--    return BinaryOperator(llvm::Instruction::Add, varyingPtr, offset, LLVMGetName(basePtr, "_offset"));
-+    return BinaryOperator(llvm::Instruction::Add, varyingPtr, offset, llvm::Twine(basePtr->getName()) + "_offset");
- }
- 
- void FunctionEmitContext::MatchIntegerTypes(llvm::Value **v0, llvm::Value **v1) {
-@@ -2006,13 +1995,13 @@ llvm::Value *FunctionEmitContext::MakeSlicePointer(llvm::Value *ptr, llvm::Value
-     llvm::StructType *st = llvm::StructType::get(*g->ctx, eltTypes);
- 
-     llvm::Value *ret = llvm::UndefValue::get(st);
--    ret = InsertInst(ret, ptr, 0, LLVMGetName(ret, "_slice_ptr"));
--    ret = InsertInst(ret, offset, 1, LLVMGetName(ret, "_slice_offset"));
-+    ret = InsertInst(ret, ptr, 0, llvm::Twine(ret->getName()) + "_slice_ptr");
-+    ret = InsertInst(ret, offset, 1, llvm::Twine(ret->getName()) + "_slice_offset");
-     return ret;
- }
- 
- llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::Value *index, const Type *ptrRefType,
--                                                    const char *name) {
-+                                                    const llvm::Twine &name) {
-     if (basePtr == NULL || index == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2065,8 +2054,8 @@ llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::
-         // uniform, so just emit the regular LLVM GEP instruction
-         llvm::Value *ind[1] = {index};
-         llvm::ArrayRef<llvm::Value *> arrayRef(&ind[0], &ind[1]);
--        llvm::Instruction *inst =
--            llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef, name ? name : "gep", bblock);
-+        llvm::Instruction *inst = llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef,
-+                                                                  name.isTriviallyEmpty() ? "gep" : name, bblock);
-         AddDebugPos(inst);
-         return inst;
-     } else
-@@ -2074,7 +2063,7 @@ llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::
- }
- 
- llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::Value *index0, llvm::Value *index1,
--                                                    const Type *ptrRefType, const char *name) {
-+                                                    const Type *ptrRefType, const llvm::Twine &name) {
-     if (basePtr == NULL || index0 == NULL || index1 == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2114,8 +2103,8 @@ llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::
-         // uniform, so just emit the regular LLVM GEP instruction
-         llvm::Value *indices[2] = {index0, index1};
-         llvm::ArrayRef<llvm::Value *> arrayRef(&indices[0], &indices[2]);
--        llvm::Instruction *inst =
--            llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef, name ? name : "gep", bblock);
-+        llvm::Instruction *inst = llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef,
-+                                                                  name.isTriviallyEmpty() ? "gep" : name, bblock);
-         AddDebugPos(inst);
-         return inst;
-     } else {
-@@ -2138,7 +2127,7 @@ llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::
- }
- 
- llvm::Value *FunctionEmitContext::AddElementOffset(llvm::Value *fullBasePtr, int elementNum, const Type *ptrRefType,
--                                                   const char *name, const PointerType **resultPtrType) {
-+                                                   const llvm::Twine &name, const PointerType **resultPtrType) {
-     if (resultPtrType != NULL)
-         AssertPos(currentPos, ptrRefType != NULL);
- 
-@@ -2195,8 +2184,8 @@ llvm::Value *FunctionEmitContext::AddElementOffset(llvm::Value *fullBasePtr, int
-         // If the pointer is uniform, we can use the regular LLVM GEP.
-         llvm::Value *offsets[2] = {LLVMInt32(0), LLVMInt32(elementNum)};
-         llvm::ArrayRef<llvm::Value *> arrayRef(&offsets[0], &offsets[2]);
--        resultPtr =
--            llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef, name ? name : "struct_offset", bblock);
-+        resultPtr = llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef,
-+                                                    name.isTriviallyEmpty() ? "struct_offset" : name, bblock);
-     } else {
-         // Otherwise do the math to find the offset and add it to the given
-         // varying pointers
-@@ -2237,7 +2226,7 @@ llvm::Value *FunctionEmitContext::AddElementOffset(llvm::Value *fullBasePtr, int
-         return resultPtr;
- }
- 
--llvm::Value *FunctionEmitContext::SwitchBoolSize(llvm::Value *value, llvm::Type *toType, const char *name) {
-+llvm::Value *FunctionEmitContext::SwitchBoolSize(llvm::Value *value, llvm::Type *toType, const llvm::Twine &name) {
-     if ((value == NULL) || (toType == NULL)) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2248,20 +2237,18 @@ llvm::Value *FunctionEmitContext::SwitchBoolSize(llvm::Value *value, llvm::Type
-     llvm::Value *newBool = value;
-     if (g->target->getDataLayout()->getTypeSizeInBits(fromType) >
-         g->target->getDataLayout()->getTypeSizeInBits(toType)) {
--        if (name == NULL)
--            name = LLVMGetName(value, "_switchBool");
--        newBool = TruncInst(value, toType, name);
-+        newBool =
-+            TruncInst(value, toType, name.isTriviallyEmpty() ? (llvm::Twine(value->getName()) + "_switchBool") : name);
-     } else if (g->target->getDataLayout()->getTypeSizeInBits(fromType) <
-                g->target->getDataLayout()->getTypeSizeInBits(toType)) {
--        if (name == NULL)
--            name = LLVMGetName(value, "_switchBool");
--        newBool = SExtInst(value, toType, name);
-+        newBool =
-+            SExtInst(value, toType, name.isTriviallyEmpty() ? (llvm::Twine(value->getName()) + "_switchBool") : name);
-     }
- 
-     return newBool;
- }
- 
--llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, const char *name) {
-+llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, const llvm::Twine &name) {
-     if (ptr == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2270,13 +2257,13 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, c
-     llvm::PointerType *pt = llvm::dyn_cast<llvm::PointerType>(ptr->getType());
-     AssertPos(currentPos, pt != NULL);
- 
--    if (name == NULL)
--        name = LLVMGetName(ptr, "_load");
--
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--    llvm::LoadInst *inst = new llvm::LoadInst(pt->getPointerElementType(), ptr, name, bblock);
-+    llvm::LoadInst *inst =
-+        new llvm::LoadInst(pt->getPointerElementType(), ptr,
-+                           name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name, bblock);
- #else
--    llvm::LoadInst *inst = new llvm::LoadInst(ptr, name, bblock);
-+    llvm::LoadInst *inst =
-+        new llvm::LoadInst(ptr, name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name, bblock);
- #endif
- 
-     if (g->opt.forceAlignedMemory && llvm::dyn_cast<llvm::VectorType>(pt->getElementType())) {
-@@ -2307,8 +2294,8 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, c
- static llvm::Value *lFinalSliceOffset(FunctionEmitContext *ctx, llvm::Value *ptr, const PointerType **ptrType) {
-     Assert(CastType<PointerType>(*ptrType) != NULL);
- 
--    llvm::Value *slicePtr = ctx->ExtractInst(ptr, 0, LLVMGetName(ptr, "_ptr"));
--    llvm::Value *sliceOffset = ctx->ExtractInst(ptr, 1, LLVMGetName(ptr, "_offset"));
-+    llvm::Value *slicePtr = ctx->ExtractInst(ptr, 0, llvm::Twine(ptr->getName()) + "_ptr");
-+    llvm::Value *sliceOffset = ctx->ExtractInst(ptr, 1, llvm::Twine(ptr->getName()) + "_offset");
- 
-     // slicePtr should be a pointer to an soa-width wide array of the
-     // final atomic/enum/pointer type
-@@ -2327,14 +2314,14 @@ static llvm::Value *lFinalSliceOffset(FunctionEmitContext *ctx, llvm::Value *ptr
-         slicePtr = ctx->BitCastInst(slicePtr, (*ptrType)->LLVMType(g->ctx));
- 
-     // And finally index based on the slice offset
--    return ctx->GetElementPtrInst(slicePtr, sliceOffset, *ptrType, LLVMGetName(slicePtr, "_final_gep"));
-+    return ctx->GetElementPtrInst(slicePtr, sliceOffset, *ptrType, llvm::Twine(slicePtr->getName()) + "_final_gep");
- }
- 
- /** Utility routine that loads from a uniform pointer to soa<> data,
-     returning a regular uniform (non-SOA result).
-  */
- llvm::Value *FunctionEmitContext::loadUniformFromSOA(llvm::Value *ptr, llvm::Value *mask, const PointerType *ptrType,
--                                                     const char *name) {
-+                                                     const llvm::Twine &name) {
-     const Type *unifType = ptrType->GetBaseType()->GetAsUniformType();
- 
-     const CollectionType *ct = CastType<CollectionType>(ptrType->GetBaseType());
-@@ -2363,7 +2350,7 @@ llvm::Value *FunctionEmitContext::loadUniformFromSOA(llvm::Value *ptr, llvm::Val
- }
- 
- llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask, const Type *ptrRefType,
--                                           const char *name, bool one_elem) {
-+                                           const llvm::Twine &name, bool one_elem) {
-     if (ptr == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2371,9 +2358,6 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
- 
-     AssertPos(currentPos, ptrRefType != NULL && mask != NULL);
- 
--    if (name == NULL)
--        name = LLVMGetName(ptr, "_load");
--
-     const PointerType *ptrType;
-     const Type *elType;
-     if (CastType<ReferenceType>(ptrRefType) != NULL) {
-@@ -2393,7 +2377,8 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
- 
-     if (ptrType->IsUniformType()) {
-         if (ptrType->IsSlice()) {
--            return loadUniformFromSOA(ptr, mask, ptrType, name);
-+            return loadUniformFromSOA(ptr, mask, ptrType,
-+                                      name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name);
-         } else {
-             // FIXME: same issue as above load inst regarding alignment...
-             //
-@@ -2405,11 +2390,15 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
-             const AtomicType *atomicType = CastType<AtomicType>(ptrType->GetBaseType());
- 
- #if ISPC_LLVM_VERSION <= ISPC_LLVM_10_0
--            llvm::LoadInst *inst = new llvm::LoadInst(ptr, name, false /* not volatile */, bblock);
-+            llvm::LoadInst *inst =
-+                new llvm::LoadInst(ptr, name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name,
-+                                   false /* not volatile */, bblock);
- #else // LLVM 11.0+
-             llvm::PointerType *ptr_type = llvm::dyn_cast<llvm::PointerType>(ptr->getType());
-             llvm::LoadInst *inst =
--                new llvm::LoadInst(ptr_type->getPointerElementType(), ptr, name, false /* not volatile */, bblock);
-+                new llvm::LoadInst(ptr_type->getPointerElementType(), ptr,
-+                                   name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name,
-+                                   false /* not volatile */, bblock);
- #endif
- 
-             if (atomicType != NULL && atomicType->IsVaryingType()) {
-@@ -2433,7 +2422,8 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
-     } else {
-         // Otherwise we should have a varying ptr and it's time for a
-         // gather.
--        llvm::Value *gather_result = gather(ptr, ptrType, GetFullMask(), name);
-+        llvm::Value *gather_result = gather(ptr, ptrType, GetFullMask(),
-+                                            name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name);
-         if (!one_elem)
-             return gather_result;
- 
-@@ -2453,19 +2443,19 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
-         // We can actually call either one, since both are i32s as far as
-         // LLVM's type system is concerned...
-         llvm::Function *fmm = mm[0]->function;
--        llvm::Value *int_mask = CallInst(fmm, NULL, mask, LLVMGetName(mask, "_movmsk"));
-+        llvm::Value *int_mask = CallInst(fmm, NULL, mask, llvm::Twine(mask->getName()) + "_movmsk");
-         std::vector<Symbol *> lz;
-         m->symbolTable->LookupFunction("__count_trailing_zeros_i64", &lz);
-         llvm::Function *flz = lz[0]->function;
--        llvm::Value *elem_idx = CallInst(flz, NULL, int_mask, LLVMGetName(mask, "_clz"));
--        llvm::Value *elem = llvm::ExtractElementInst::Create(gather_result, elem_idx,
--                                                             LLVMGetName(gather_result, "_umasked_elem"), bblock);
-+        llvm::Value *elem_idx = CallInst(flz, NULL, int_mask, llvm::Twine(mask->getName()) + "_clz");
-+        llvm::Value *elem = llvm::ExtractElementInst::Create(
-+            gather_result, elem_idx, llvm::Twine(gather_result->getName()) + "_umasked_elem", bblock);
-         return elem;
-     }
- }
- 
- llvm::Value *FunctionEmitContext::gather(llvm::Value *ptr, const PointerType *ptrType, llvm::Value *mask,
--                                         const char *name) {
-+                                         const llvm::Twine &name) {
-     // We should have a varying pointer if we get here...
-     AssertPos(currentPos, ptrType->IsVaryingType());
- 
-@@ -2602,7 +2592,8 @@ void FunctionEmitContext::addGSMetadata(llvm::Value *v, SourcePos pos) {
-     inst->setMetadata("last_column", md);
- }
- 
--llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const char *name, int align, bool atEntryBlock) {
-+llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const llvm::Twine &name, int align,
-+                                             bool atEntryBlock) {
-     if (llvmType == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2615,12 +2606,12 @@ llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const char *n
-         llvm::Instruction *retInst = allocaBlock->getTerminator();
-         AssertPos(currentPos, retInst);
-         unsigned AS = llvmFunction->getParent()->getDataLayout().getAllocaAddrSpace();
--        inst = new llvm::AllocaInst(llvmType, AS, name ? name : "", retInst);
-+        inst = new llvm::AllocaInst(llvmType, AS, name, retInst);
-     } else {
-         // Unless the caller overrode the default and wants it in the
-         // current basic block
-         unsigned AS = llvmFunction->getParent()->getDataLayout().getAllocaAddrSpace();
--        inst = new llvm::AllocaInst(llvmType, AS, name ? name : "", bblock);
-+        inst = new llvm::AllocaInst(llvmType, AS, name, bblock);
-     }
- 
-     // If no alignment was specified but we have an array of a uniform
-@@ -2639,7 +2630,8 @@ llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const char *n
-     return inst;
- }
- 
--llvm::Value *FunctionEmitContext::AllocaInst(const Type *ptrType, const char *name, int align, bool atEntryBlock) {
-+llvm::Value *FunctionEmitContext::AllocaInst(const Type *ptrType, const llvm::Twine &name, int align,
-+                                             bool atEntryBlock) {
-     if (ptrType == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -3075,66 +3067,59 @@ llvm::Instruction *FunctionEmitContext::BranchInst(llvm::BasicBlock *trueBlock,
-     return b;
- }
- 
--llvm::Value *FunctionEmitContext::ExtractInst(llvm::Value *v, int elt, const char *name) {
-+llvm::Value *FunctionEmitContext::ExtractInst(llvm::Value *v, int elt, const llvm::Twine &name) {
-     if (v == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL) {
--        char buf[32];
--        snprintf(buf, sizeof(buf), "_extract_%d", elt);
--        name = LLVMGetName(v, buf);
--    }
-     llvm::Instruction *ei = NULL;
-     if (llvm::isa<llvm::VectorType>(v->getType()))
--        ei = llvm::ExtractElementInst::Create(v, LLVMInt32(elt), name, bblock);
-+        ei = llvm::ExtractElementInst::Create(
-+            v, LLVMInt32(elt),
-+            name.isTriviallyEmpty() ? ((llvm::Twine(v->getName()) + "_extract_") + llvm::Twine(elt)) : name, bblock);
-     else
--        ei = llvm::ExtractValueInst::Create(v, elt, name, bblock);
-+        ei = llvm::ExtractValueInst::Create(
-+            v, elt, name.isTriviallyEmpty() ? ((llvm::Twine(v->getName()) + "_extract_") + llvm::Twine(elt)) : name,
-+            bblock);
-     AddDebugPos(ei);
-     return ei;
- }
- 
--llvm::Value *FunctionEmitContext::InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt, const char *name) {
-+llvm::Value *FunctionEmitContext::InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt, const llvm::Twine &name) {
-     if (v == NULL || eltVal == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL) {
--        char buf[32];
--        snprintf(buf, sizeof(buf), "_insert_%d", elt);
--        name = LLVMGetName(v, buf);
--    }
--
-     llvm::Instruction *ii = NULL;
-     if (llvm::isa<llvm::VectorType>(v->getType()))
--        ii = llvm::InsertElementInst::Create(v, eltVal, LLVMInt32(elt), name, bblock);
-+        ii = llvm::InsertElementInst::Create(
-+            v, eltVal, LLVMInt32(elt),
-+            name.isTriviallyEmpty() ? ((llvm::Twine(v->getName()) + "_insert_") + llvm::Twine(elt)) : name, bblock);
-     else
--        ii = llvm::InsertValueInst::Create(v, eltVal, elt, name, bblock);
-+        ii = llvm::InsertValueInst::Create(
-+            v, eltVal, elt,
-+            name.isTriviallyEmpty() ? ((llvm::Twine(v->getName()) + "_insert_") + llvm::Twine(elt)) : name, bblock);
-     AddDebugPos(ii);
-     return ii;
- }
- 
--llvm::Value *FunctionEmitContext::ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask, const char *name) {
-+llvm::Value *FunctionEmitContext::ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask,
-+                                              const llvm::Twine &name) {
-     if (v1 == NULL || v2 == NULL || mask == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL) {
--        char buf[32];
--        snprintf(buf, sizeof(buf), "_shuffle");
--        name = LLVMGetName(v1, buf);
--    }
--
--    llvm::Instruction *ii = new llvm::ShuffleVectorInst(v1, v2, mask, name, bblock);
-+    llvm::Instruction *ii = new llvm::ShuffleVectorInst(
-+        v1, v2, mask, name.isTriviallyEmpty() ? (llvm::Twine(v1->getName()) + "_shuffle") : name, bblock);
- 
-     AddDebugPos(ii);
-     return ii;
- }
- 
--llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vecType, const char *name) {
-+llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vecType, const llvm::Twine &name) {
-     if (v == NULL || vecType == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -3148,12 +3133,6 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
-     Assert(ty && ty->getVectorElementType() == v->getType());
- #endif
- 
--    if (name == NULL) {
--        char buf[32];
--        snprintf(buf, sizeof(buf), "_broadcast");
--        name = LLVMGetName(v, buf);
--    }
--
-     // Generate the following sequence:
-     //   %name_init.i = insertelement <4 x i32> undef, i32 %val, i32 0
-     //   %name.i = shufflevector <4 x i32> %name_init.i, <4 x i32> undef,
-@@ -3163,7 +3142,7 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
-     llvm::Value *undef2 = llvm::UndefValue::get(vecType);
- 
-     // InsertElement
--    llvm::Twine tw = llvm::Twine(name) + llvm::Twine("_init");
-+    llvm::Twine tw = name.isTriviallyEmpty() ? (llvm::Twine(v->getName()) + "_broadcast") : name + llvm::Twine("_init");
-     llvm::Value *insert = InsertInst(undef1, v, 0, tw.str().c_str());
- 
-     // ShuffleVector
-@@ -3179,28 +3158,27 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
-         llvm::ConstantVector::getSplat(llvm::ElementCount::get(static_cast<unsigned int>(ty->getNumElements()), false),
-                                        llvm::Constant::getNullValue(llvm::Type::getInt32Ty(*g->ctx)));
- #endif
--    llvm::Value *ret = ShuffleInst(insert, undef2, zeroVec, name);
-+    llvm::Value *ret = ShuffleInst(insert, undef2, zeroVec,
-+                                   name.isTriviallyEmpty() ? (llvm::Twine(v->getName()) + "_broadcast") : name);
- 
-     return ret;
- }
- 
--llvm::PHINode *FunctionEmitContext::PhiNode(llvm::Type *type, int count, const char *name) {
--    llvm::PHINode *pn = llvm::PHINode::Create(type, count, name ? name : "phi", bblock);
-+llvm::PHINode *FunctionEmitContext::PhiNode(llvm::Type *type, int count, const llvm::Twine &name) {
-+    llvm::PHINode *pn = llvm::PHINode::Create(type, count, name.isTriviallyEmpty() ? "phi" : name, bblock);
-     AddDebugPos(pn);
-     return pn;
- }
- 
- llvm::Instruction *FunctionEmitContext::SelectInst(llvm::Value *test, llvm::Value *val0, llvm::Value *val1,
--                                                   const char *name) {
-+                                                   const llvm::Twine &name) {
-     if (test == NULL || val0 == NULL || val1 == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(test, "_select");
--
--    llvm::Instruction *inst = llvm::SelectInst::Create(test, val0, val1, name, bblock);
-+    llvm::Instruction *inst = llvm::SelectInst::Create(
-+        test, val0, val1, name.isTriviallyEmpty() ? (llvm::Twine(test->getName()) + "_select") : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
-@@ -3226,7 +3204,7 @@ static unsigned int lCalleeArgCount(llvm::Value *callee, const FunctionType *fun
- }
- 
- llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType *funcType,
--                                           const std::vector<llvm::Value *> &args, const char *name) {
-+                                           const std::vector<llvm::Value *> &args, const llvm::Twine &name) {
-     if (func == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -3258,9 +3236,9 @@ llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-         llvm::PointerType *func_ptr_type = llvm::dyn_cast<llvm::PointerType>(func->getType());
-         llvm::FunctionType *func_type = llvm::dyn_cast<llvm::FunctionType>(func_ptr_type->getPointerElementType());
--        llvm::CallInst *callinst = llvm::CallInst::Create(func_type, func, argVals, name ? name : "", bblock);
-+        llvm::CallInst *callinst = llvm::CallInst::Create(func_type, func, argVals, name, bblock);
- #else
--        llvm::CallInst *callinst = llvm::CallInst::Create(func, argVals, name ? name : "", bblock);
-+        llvm::CallInst *callinst = llvm::CallInst::Create(func, argVals, name, bblock);
- #endif
- 
-         // We could be dealing with a function pointer in which case this will not be a 'llvm::Function'.
-@@ -3464,14 +3442,14 @@ llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType
- }
- 
- llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg,
--                                           const char *name) {
-+                                           const llvm::Twine &name) {
-     std::vector<llvm::Value *> args;
-     args.push_back(arg);
-     return CallInst(func, funcType, args, name);
- }
- 
- llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg0,
--                                           llvm::Value *arg1, const char *name) {
-+                                           llvm::Value *arg1, const llvm::Twine &name) {
-     std::vector<llvm::Value *> args;
-     args.push_back(arg0);
-     args.push_back(arg1);
-diff --git a/src/ctx.h b/src/ctx.h
-index 6e5ad74ba..48b3bb826 100644
---- a/src/ctx.h
-+++ b/src/ctx.h
-@@ -302,7 +302,7 @@ class FunctionEmitContext {
-     llvm::Value *GetStringPtr(const std::string &str);
- 
-     /** Create a new basic block with given name */
--    llvm::BasicBlock *CreateBasicBlock(const char *name, llvm::BasicBlock *insertAfter = NULL);
-+    llvm::BasicBlock *CreateBasicBlock(const llvm::Twine &name, llvm::BasicBlock *insertAfter = NULL);
- 
-     /** Given a vector with element type i1, return a vector of type
-         LLVMTypes::BoolVectorType.  This method handles the conversion for
-@@ -380,33 +380,33 @@ class FunctionEmitContext {
-         this also handles applying the given operation to the vector
-         elements. */
-     llvm::Value *BinaryOperator(llvm::Instruction::BinaryOps inst, llvm::Value *v0, llvm::Value *v1,
--                                const char *name = NULL);
-+                                const llvm::Twine &name = "");
- 
-     /** Emit the "not" operator.  Like BinaryOperator(), this also handles
-         a VectorType-based operand. */
--    llvm::Value *NotOperator(llvm::Value *v, const char *name = NULL);
-+    llvm::Value *NotOperator(llvm::Value *v, const llvm::Twine &name = "");
- 
-     /** Emit a comparison instruction.  If the operands are VectorTypes,
-         then a value for the corresponding boolean VectorType is
-         returned. */
-     llvm::Value *CmpInst(llvm::Instruction::OtherOps inst, llvm::CmpInst::Predicate pred, llvm::Value *v0,
--                         llvm::Value *v1, const char *name = NULL);
-+                         llvm::Value *v1, const llvm::Twine &name = "");
- 
-     /** Given a scalar value, return a vector of the same type (or an
-         array, for pointer types). */
--    llvm::Value *SmearUniform(llvm::Value *value, const char *name = NULL);
-+    llvm::Value *SmearUniform(llvm::Value *value, const llvm::Twine &name = "");
- 
--    llvm::Value *BitCastInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
--    llvm::Value *PtrToIntInst(llvm::Value *value, const char *name = NULL);
--    llvm::Value *PtrToIntInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
--    llvm::Value *IntToPtrInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
-+    llvm::Value *BitCastInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-+    llvm::Value *PtrToIntInst(llvm::Value *value, const llvm::Twine &name = "");
-+    llvm::Value *PtrToIntInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-+    llvm::Value *IntToPtrInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
- 
--    llvm::Instruction *TruncInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
-+    llvm::Instruction *TruncInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-     llvm::Instruction *CastInst(llvm::Instruction::CastOps op, llvm::Value *value, llvm::Type *type,
--                                const char *name = NULL);
--    llvm::Instruction *FPCastInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
--    llvm::Instruction *SExtInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
--    llvm::Instruction *ZExtInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
-+                                const llvm::Twine &name = "");
-+    llvm::Instruction *FPCastInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-+    llvm::Instruction *SExtInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-+    llvm::Instruction *ZExtInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
- 
-     /** Given two integer-typed values (but possibly one vector and the
-         other not, and or of possibly-different bit-widths), update their
-@@ -426,9 +426,9 @@ class FunctionEmitContext {
-         pointers.  The underlying type of the base pointer must be provided
-         via the ptrType parameter */
-     llvm::Value *GetElementPtrInst(llvm::Value *basePtr, llvm::Value *index, const Type *ptrType,
--                                   const char *name = NULL);
-+                                   const llvm::Twine &name = "");
-     llvm::Value *GetElementPtrInst(llvm::Value *basePtr, llvm::Value *index0, llvm::Value *index1, const Type *ptrType,
--                                   const char *name = NULL);
-+                                   const llvm::Twine &name = "");
- 
-     /** This method returns a new pointer that represents offsetting the
-         given base pointer to point at the given element number of the
-@@ -436,26 +436,26 @@ class FunctionEmitContext {
-         pointer must be a pointer to a structure type.  The ptrType gives
-         the type of the pointer, though it may be NULL if the base pointer
-         is uniform. */
--    llvm::Value *AddElementOffset(llvm::Value *basePtr, int elementNum, const Type *ptrType, const char *name = NULL,
--                                  const PointerType **resultPtrType = NULL);
-+    llvm::Value *AddElementOffset(llvm::Value *basePtr, int elementNum, const Type *ptrType,
-+                                  const llvm::Twine &name = "", const PointerType **resultPtrType = NULL);
- 
-     /** Bool is stored as i8 and <WIDTH x i8> but represented in IR as i1 and
-      * <WIDTH x MASK>. This is a helper function to match bool size at storage
-      * interface. */
--    llvm::Value *SwitchBoolSize(llvm::Value *value, llvm::Type *toType, const char *name = NULL);
-+    llvm::Value *SwitchBoolSize(llvm::Value *value, llvm::Type *toType, const llvm::Twine &name = "");
-     /** Load from the memory location(s) given by lvalue, using the given
-         mask.  The lvalue may be varying, in which case this corresponds to
-         a gather from the multiple memory locations given by the array of
-         pointer values given by the lvalue.  If the lvalue is not varying,
-         then both the mask pointer and the type pointer may be NULL. */
--    llvm::Value *LoadInst(llvm::Value *ptr, llvm::Value *mask, const Type *ptrType, const char *name = NULL,
-+    llvm::Value *LoadInst(llvm::Value *ptr, llvm::Value *mask, const Type *ptrType, const llvm::Twine &name = "",
-                           bool one_elem = false);
- 
-     /* Load from memory location(s) given.
-      * 'type' needs to be provided when storage type is different from IR type. For example,
-      * 'unform bool' is 'i1' in IR but stored as 'i8'.
-      * Otherwise leave this as NULL. */
--    llvm::Value *LoadInst(llvm::Value *ptr, const Type *type = NULL, const char *name = NULL);
-+    llvm::Value *LoadInst(llvm::Value *ptr, const Type *type = NULL, const llvm::Twine &name = "");
- 
-     /** Emits an alloca instruction to allocate stack storage for the given
-         type.  If a non-zero alignment is specified, the object is also
-@@ -463,7 +463,8 @@ class FunctionEmitContext {
-         instruction is added at the start of the function in the entry
-         basic block; if it should be added to the current basic block, then
-         the atEntryBlock parameter should be false. */
--    llvm::Value *AllocaInst(llvm::Type *llvmType, const char *name = NULL, int align = 0, bool atEntryBlock = true);
-+    llvm::Value *AllocaInst(llvm::Type *llvmType, const llvm::Twine &name = "", int align = 0,
-+                            bool atEntryBlock = true);
- 
-     /** Emits an alloca instruction to allocate stack storage for the given
-         type.  If a non-zero alignment is specified, the object is also
-@@ -474,7 +475,7 @@ class FunctionEmitContext {
-         This implementation is preferred when possible. It is needed when
-         storage type is different from IR type. For example,
-         'unform bool' is 'i1' in IR but stored as 'i8'. */
--    llvm::Value *AllocaInst(const Type *ptrType, const char *name = NULL, int align = 0, bool atEntryBlock = true);
-+    llvm::Value *AllocaInst(const Type *ptrType, const llvm::Twine &name = "", int align = 0, bool atEntryBlock = true);
- 
-     /** Standard store instruction; for this variant, the lvalue must be a
-         single pointer, not a varying lvalue.
-@@ -502,39 +503,41 @@ class FunctionEmitContext {
-     /** This convenience method maps to an llvm::ExtractElementInst if the
-         given value is a llvm::VectorType, and to an llvm::ExtractValueInst
-         otherwise. */
--    llvm::Value *ExtractInst(llvm::Value *v, int elt, const char *name = NULL);
-+    llvm::Value *ExtractInst(llvm::Value *v, int elt, const llvm::Twine &name = "");
- 
-     /** This convenience method maps to an llvm::InsertElementInst if the
-         given value is a llvm::VectorType, and to an llvm::InsertValueInst
-         otherwise. */
--    llvm::Value *InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt, const char *name = NULL);
-+    llvm::Value *InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt, const llvm::Twine &name = "");
- 
-     /** This convenience method maps to an llvm::ShuffleVectorInst. */
--    llvm::Value *ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask, const char *name = NULL);
-+    llvm::Value *ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask, const llvm::Twine &name = "");
- 
-     /** This convenience method to generate broadcast pattern. It takes a value
-         and a vector type. Type of the value must match element type of the
-         vector. */
--    llvm::Value *BroadcastValue(llvm::Value *v, llvm::Type *vecType, const char *name = NULL);
-+    llvm::Value *BroadcastValue(llvm::Value *v, llvm::Type *vecType, const llvm::Twine &name = "");
- 
--    llvm::PHINode *PhiNode(llvm::Type *type, int count, const char *name = NULL);
--    llvm::Instruction *SelectInst(llvm::Value *test, llvm::Value *val0, llvm::Value *val1, const char *name = NULL);
-+    llvm::PHINode *PhiNode(llvm::Type *type, int count, const llvm::Twine &name = "");
-+    llvm::Instruction *SelectInst(llvm::Value *test, llvm::Value *val0, llvm::Value *val1,
-+                                  const llvm::Twine &name = "");
- 
-     /** Emits IR to do a function call with the given arguments.  If the
-         function type is a varying function pointer type, its full type
-         must be provided in funcType.  funcType can be NULL if func is a
-         uniform function pointer. */
-     llvm::Value *CallInst(llvm::Value *func, const FunctionType *funcType, const std::vector<llvm::Value *> &args,
--                          const char *name = NULL);
-+                          const llvm::Twine &name = "");
- 
-     /** This is a convenience method that issues a call instruction to a
-         function that takes just a single argument. */
--    llvm::Value *CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg, const char *name = NULL);
-+    llvm::Value *CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg,
-+                          const llvm::Twine &name = "");
- 
-     /** This is a convenience method that issues a call instruction to a
-         function that takes two arguments. */
-     llvm::Value *CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg0, llvm::Value *arg1,
--                          const char *name = NULL);
-+                          const llvm::Twine &name = "");
- 
-     /** Launch an asynchronous task to run the given function, passing it
-         he given argument values. */
-@@ -756,9 +759,10 @@ class FunctionEmitContext {
-     void maskedStore(llvm::Value *value, llvm::Value *ptr, const Type *ptrType, llvm::Value *mask);
-     void storeUniformToSOA(llvm::Value *value, llvm::Value *ptr, llvm::Value *mask, const Type *valueType,
-                            const PointerType *ptrType);
--    llvm::Value *loadUniformFromSOA(llvm::Value *ptr, llvm::Value *mask, const PointerType *ptrType, const char *name);
-+    llvm::Value *loadUniformFromSOA(llvm::Value *ptr, llvm::Value *mask, const PointerType *ptrType,
-+                                    const llvm::Twine &name = "");
- 
--    llvm::Value *gather(llvm::Value *ptr, const PointerType *ptrType, llvm::Value *mask, const char *name);
-+    llvm::Value *gather(llvm::Value *ptr, const PointerType *ptrType, llvm::Value *mask, const llvm::Twine &name = "");
- 
-     llvm::Value *addVaryingOffsetsIfNeeded(llvm::Value *ptr, const Type *ptrType);
- };
-diff --git a/src/expr.cpp b/src/expr.cpp
-index 80cc3020a..6d38d1889 100644
---- a/src/expr.cpp
-+++ b/src/expr.cpp
-@@ -1021,11 +1021,11 @@ static llvm::Value *lEmitNegate(Expr *arg, SourcePos pos, FunctionEmitContext *c
-     ctx->SetDebugPos(pos);
-     if (type->IsFloatType()) {
-         llvm::Value *zero = llvm::ConstantFP::getZeroValueForNegation(type->LLVMType(g->ctx));
--        return ctx->BinaryOperator(llvm::Instruction::FSub, zero, argVal, LLVMGetName(argVal, "_negate"));
-+        return ctx->BinaryOperator(llvm::Instruction::FSub, zero, argVal, llvm::Twine(argVal->getName()) + "_negate");
-     } else {
-         llvm::Value *zero = lLLVMConstantValue(type, g->ctx, 0.);
-         AssertPos(pos, type->IsIntType());
--        return ctx->BinaryOperator(llvm::Instruction::Sub, zero, argVal, LLVMGetName(argVal, "_negate"));
-+        return ctx->BinaryOperator(llvm::Instruction::Sub, zero, argVal, llvm::Twine(argVal->getName()) + "_negate");
-     }
- }
- 
-@@ -1047,11 +1047,11 @@ llvm::Value *UnaryExpr::GetValue(FunctionEmitContext *ctx) const {
-         return lEmitNegate(expr, pos, ctx);
-     case LogicalNot: {
-         llvm::Value *argVal = expr->GetValue(ctx);
--        return ctx->NotOperator(argVal, LLVMGetName(argVal, "_logicalnot"));
-+        return ctx->NotOperator(argVal, llvm::Twine(argVal->getName()) + "_logicalnot");
-     }
-     case BitNot: {
-         llvm::Value *argVal = expr->GetValue(ctx);
--        return ctx->NotOperator(argVal, LLVMGetName(argVal, "_bitnot"));
-+        return ctx->NotOperator(argVal, llvm::Twine(argVal->getName()) + "_bitnot");
-     }
-     default:
-         FATAL("logic error");
-@@ -1518,7 +1518,8 @@ static llvm::Value *lEmitBinaryArith(BinaryExpr::Op op, llvm::Value *value0, llv
-             return NULL;
-         }
- 
--        return ctx->BinaryOperator(inst, value0, value1, LLVMGetName(opName, value0, value1));
-+        return ctx->BinaryOperator(inst, value0, value1,
-+                                   (((llvm::Twine(opName) + "_") + value0->getName()) + "_") + value1->getName());
-     }
- }
- 
-@@ -1563,7 +1564,7 @@ static llvm::Value *lEmitBinaryCmp(BinaryExpr::Op op, llvm::Value *e0Val, llvm::
-     }
- 
-     llvm::Value *cmp = ctx->CmpInst(isFloatOp ? llvm::Instruction::FCmp : llvm::Instruction::ICmp, pred, e0Val, e1Val,
--                                    LLVMGetName(opName, e0Val, e1Val));
-+                                    (((llvm::Twine(opName) + "_") + e0Val->getName()) + "_") + e1Val->getName());
-     // This is a little ugly: CmpInst returns i1 values, but we use vectors
-     // of i32s for varying bool values; type convert the result here if
-     // needed.
-@@ -4177,7 +4178,7 @@ static llvm::Value *lConvertToSlicePointer(FunctionEmitContext *ctx, llvm::Value
-     // offsets
-     llvm::Value *result = llvm::Constant::getNullValue(sliceStructType);
-     // And replace the pointer in the struct with the given pointer
--    return ctx->InsertInst(result, ptr, 0, LLVMGetName(ptr, "_slice"));
-+    return ctx->InsertInst(result, ptr, 0, llvm::Twine(ptr->getName()) + "_slice");
- }
- 
- /** If the given array index is a compile time constant, check to see if it
-@@ -4258,8 +4259,8 @@ llvm::Value *IndexExpr::GetLValue(FunctionEmitContext *ctx) const {
-         // Convert to a slice pointer if we're indexing into SOA data
-         basePtrValue = lConvertPtrToSliceIfNeeded(ctx, basePtrValue, &baseExprType);
- 
--        llvm::Value *ptr =
--            ctx->GetElementPtrInst(basePtrValue, indexValue, baseExprType, LLVMGetName(basePtrValue, "_offset"));
-+        llvm::Value *ptr = ctx->GetElementPtrInst(basePtrValue, indexValue, baseExprType,
-+                                                  llvm::Twine(basePtrValue->getName()) + "_offset");
-         return lAddVaryingOffsetsIfNeeded(ctx, ptr, GetLValueType());
-     }
- 
-@@ -4290,8 +4291,8 @@ llvm::Value *IndexExpr::GetLValue(FunctionEmitContext *ctx) const {
-     ctx->SetDebugPos(pos);
- 
-     // And do the actual indexing calculation..
--    llvm::Value *ptr =
--        ctx->GetElementPtrInst(basePtr, LLVMInt32(0), indexValue, basePtrType, LLVMGetName(basePtr, "_offset"));
-+    llvm::Value *ptr = ctx->GetElementPtrInst(basePtr, LLVMInt32(0), indexValue, basePtrType,
-+                                              llvm::Twine(basePtr->getName()) + "_offset");
-     return lAddVaryingOffsetsIfNeeded(ctx, ptr, GetLValueType());
- }
- 
-@@ -4788,15 +4789,14 @@ llvm::Value *VectorMemberExpr::GetValue(FunctionEmitContext *ctx) const {
-         for (size_t i = 0; i < identifier.size(); ++i) {
-             char idStr[2] = {identifier[i], '\0'};
-             llvm::Value *elementPtr =
--                ctx->AddElementOffset(basePtr, indices[i], basePtrType, LLVMGetName(basePtr, idStr));
-+                ctx->AddElementOffset(basePtr, indices[i], basePtrType, llvm::Twine(basePtr->getName()) + idStr);
-             llvm::Value *elementValue = ctx->LoadInst(elementPtr, elementMask, elementPtrType);
- 
--            const char *resultName = LLVMGetName(resultPtr, idStr);
--            llvm::Value *ptmp = ctx->AddElementOffset(resultPtr, i, NULL, resultName);
-+            llvm::Value *ptmp = ctx->AddElementOffset(resultPtr, i, NULL, llvm::Twine(resultPtr->getName()) + idStr);
-             ctx->StoreInst(elementValue, ptmp, elementPtrType, expr->GetType()->IsUniformType());
-         }
- 
--        return ctx->LoadInst(resultPtr, memberType, LLVMGetName(basePtr, "_swizzle"));
-+        return ctx->LoadInst(resultPtr, memberType, llvm::Twine(basePtr->getName()) + "_swizzle");
-     }
- }
- 
-@@ -4932,7 +4932,7 @@ llvm::Value *MemberExpr::GetValue(FunctionEmitContext *ctx) const {
- 
-     ctx->SetDebugPos(pos);
-     std::string suffix = std::string("_") + identifier;
--    return ctx->LoadInst(lvalue, mask, lvalueType, LLVMGetName(lvalue, suffix.c_str()));
-+    return ctx->LoadInst(lvalue, mask, lvalueType, llvm::Twine(lvalue->getName()) + suffix);
- }
- 
- const Type *MemberExpr::GetType() const { return NULL; }
-@@ -6502,7 +6502,7 @@ static llvm::Value *lTypeConvAtomic(FunctionEmitContext *ctx, llvm::Value *exprV
-                 // does for everyone else...
-                 Assert(cast);
-                 cast = ctx->SwitchBoolSize(cast, LLVMTypes::BoolVectorType->getElementType(),
--                                           LLVMGetName(cast, "to_i_bool"));
-+                                           llvm::Twine(cast->getName()) + "to_i_bool");
-             }
-         } else {
-             // fromType->IsVaryingType())
-@@ -8246,7 +8246,7 @@ llvm::Value *NewExpr::GetValue(FunctionEmitContext *ctx) const {
-         // pointer of the return type and to run the code for initializers,
-         // if present.
-         llvm::Type *ptrType = retType->LLVMType(g->ctx);
--        ptrValue = ctx->BitCastInst(ptrValue, ptrType, LLVMGetName(ptrValue, "_cast_ptr"));
-+        ptrValue = ctx->BitCastInst(ptrValue, ptrType, llvm::Twine(ptrValue->getName()) + "_cast_ptr");
- 
-         if (initExpr != NULL)
-             InitSymbol(ptrValue, allocType, initExpr, ctx, pos);
-diff --git a/src/llvmutil.cpp b/src/llvmutil.cpp
-index 970175dbf..d0becb9f5 100644
---- a/src/llvmutil.cpp
-+++ b/src/llvmutil.cpp
-@@ -1605,23 +1605,6 @@ llvm::Value *LLVMShuffleVectors(llvm::Value *v1, llvm::Value *v2, int32_t shuf[]
-     return new llvm::ShuffleVectorInst(v1, v2, vec, "shuffle", insertBefore);
- }
- 
--const char *LLVMGetName(llvm::Value *v, const char *s) {
--    if (v == NULL)
--        return s;
--    std::string ret = std::string(v->getName());
--    ret += s;
--    return strdup(ret.c_str());
--}
--
--const char *LLVMGetName(const char *op, llvm::Value *v1, llvm::Value *v2) {
--    std::string r = op;
--    r += "_";
--    r += v1->getName().str();
--    r += "_";
--    r += v2->getName().str();
--    return strdup(r.c_str());
--}
--
- #ifdef ISPC_GENX_ENABLED
- bool lIsSVMLoad(llvm::Instruction *inst) {
-     Assert(inst);
-diff --git a/src/llvmutil.h b/src/llvmutil.h
-index 42cce4d83..07d089bb4 100644
---- a/src/llvmutil.h
-+++ b/src/llvmutil.h
-@@ -328,11 +328,6 @@ extern llvm::Value *LLVMConcatVectors(llvm::Value *v1, llvm::Value *v2, llvm::In
- extern llvm::Value *LLVMShuffleVectors(llvm::Value *v1, llvm::Value *v2, int32_t shuf[], int shufSize,
-                                        llvm::Instruction *insertBefore);
- 
--/** Utility routines to concat strings with the names of existing values to
--    create meaningful new names for instruction values.
--*/
--extern const char *LLVMGetName(llvm::Value *v, const char *);
--extern const char *LLVMGetName(const char *op, llvm::Value *v1, llvm::Value *v2);
- #ifdef ISPC_GENX_ENABLED
- enum AddressSpace { Local, Global, External };
- 
-diff --git a/src/opt.cpp b/src/opt.cpp
-index 5b1ac7b63..9d6cae058 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -257,7 +257,7 @@ static bool lGetSourcePosFromMetadata(const llvm::Instruction *inst, SourcePos *
-     return true;
- }
- 
--static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, const char *name,
-+static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, const llvm::Twine &name,
-                                     llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[2] = {arg0, arg1};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[2]);
-@@ -265,21 +265,22 @@ static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llv
- }
- 
- static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, llvm::Value *arg2,
--                                    const char *name, llvm::Instruction *insertBefore = NULL) {
-+                                    const llvm::Twine &name, llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[3] = {arg0, arg1, arg2};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[3]);
-     return llvm::CallInst::Create(func, newArgArray, name, insertBefore);
- }
- 
- static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, llvm::Value *arg2,
--                                    llvm::Value *arg3, const char *name, llvm::Instruction *insertBefore = NULL) {
-+                                    llvm::Value *arg3, const llvm::Twine &name,
-+                                    llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[4] = {arg0, arg1, arg2, arg3};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[4]);
-     return llvm::CallInst::Create(func, newArgArray, name, insertBefore);
- }
- 
- static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, llvm::Value *arg2,
--                                    llvm::Value *arg3, llvm::Value *arg4, const char *name,
-+                                    llvm::Value *arg3, llvm::Value *arg4, const llvm::Twine &name,
-                                     llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[5] = {arg0, arg1, arg2, arg3, arg4};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[5]);
-@@ -287,7 +288,7 @@ static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llv
- }
- 
- static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, llvm::Value *arg2,
--                                    llvm::Value *arg3, llvm::Value *arg4, llvm::Value *arg5, const char *name,
-+                                    llvm::Value *arg3, llvm::Value *arg4, llvm::Value *arg5, const llvm::Twine &name,
-                                     llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[6] = {arg0, arg1, arg2, arg3, arg4, arg5};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[6]);
-@@ -991,23 +992,24 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 llvm::Type *returnType = callInst->getType();
-                 Assert(llvm::isa<llvm::VectorType>(returnType));
-                 // cast the i8 * to the appropriate type
--                const char *name = LLVMGetName(callInst->getArgOperand(0), "_cast");
--                llvm::Value *castPtr = new llvm::BitCastInst(callInst->getArgOperand(0),
--                                                             llvm::PointerType::get(returnType, 0), name, callInst);
-+                llvm::Value *castPtr =
-+                    new llvm::BitCastInst(callInst->getArgOperand(0), llvm::PointerType::get(returnType, 0),
-+                                          llvm::Twine(callInst->getArgOperand(0)->getName()) + "_cast", callInst);
-                 lCopyMetadata(castPtr, callInst);
-                 int align;
-                 if (g->opt.forceAlignedMemory)
-                     align = g->target->getNativeVectorAlignment();
-                 else
-                     align = callInst->getCalledFunction() == avxMaskedLoad32 ? 4 : 8;
--                name = LLVMGetName(callInst->getArgOperand(0), "_load");
- #if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
--                llvm::Instruction *loadInst = new llvm::LoadInst(castPtr, name, false /* not volatile */,
--                                                                 llvm::MaybeAlign(align), (llvm::Instruction *)NULL);
-+                llvm::Instruction *loadInst =
-+                    new llvm::LoadInst(castPtr, llvm::Twine(callInst->getArgOperand(0)->getName()) + "_load",
-+                                       false /* not volatile */, llvm::MaybeAlign(align), (llvm::Instruction *)NULL);
- #else
-                 llvm::Instruction *loadInst = new llvm::LoadInst(
--                    llvm::dyn_cast<llvm::PointerType>(castPtr->getType())->getPointerElementType(), castPtr, name,
--                    false /* not volatile */, llvm::MaybeAlign(align).valueOrOne(), (llvm::Instruction *)NULL);
-+                    llvm::dyn_cast<llvm::PointerType>(castPtr->getType())->getPointerElementType(), castPtr,
-+                    llvm::Twine(callInst->getArgOperand(0)->getName()) + "_load", false /* not volatile */,
-+                    llvm::MaybeAlign(align).valueOrOne(), (llvm::Instruction *)NULL);
- #endif
-                 lCopyMetadata(loadInst, callInst);
-                 llvm::ReplaceInstWithInst(callInst, loadInst);
-@@ -1028,9 +1030,9 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 // all lanes storing, so replace with a regular store
-                 llvm::Value *rvalue = callInst->getArgOperand(2);
-                 llvm::Type *storeType = rvalue->getType();
--                const char *name = LLVMGetName(callInst->getArgOperand(0), "_ptrcast");
--                llvm::Value *castPtr = new llvm::BitCastInst(callInst->getArgOperand(0),
--                                                             llvm::PointerType::get(storeType, 0), name, callInst);
-+                llvm::Value *castPtr =
-+                    new llvm::BitCastInst(callInst->getArgOperand(0), llvm::PointerType::get(storeType, 0),
-+                                          llvm::Twine(callInst->getArgOperand(0)->getName()) + "_ptrcast", callInst);
-                 lCopyMetadata(castPtr, callInst);
- 
-                 int align;
-@@ -1339,8 +1341,8 @@ static llvm::Value *lGetBasePointer(llvm::Value *v, llvm::Instruction *insertBef
-         if (t == NULL) {
-             return NULL;
-         } else {
--            return llvm::CastInst::Create(ci->getOpcode(), t, ci->getType()->getScalarType(), LLVMGetName(t, "_cast"),
--                                          insertBefore);
-+            return llvm::CastInst::Create(ci->getOpcode(), t, ci->getType()->getScalarType(),
-+                                          llvm::Twine(t->getName()) + "_cast", insertBefore);
-         }
-     }
- 
-@@ -1583,13 +1585,13 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-         if (co == NULL)
-             *constOffset = NULL;
-         else
--            *constOffset =
--                llvm::CastInst::Create(cast->getOpcode(), co, cast->getType(), LLVMGetName(co, "_cast"), insertBefore);
-+            *constOffset = llvm::CastInst::Create(cast->getOpcode(), co, cast->getType(),
-+                                                  llvm::Twine(co->getName()) + "_cast", insertBefore);
-         if (vo == NULL)
-             *variableOffset = NULL;
-         else
--            *variableOffset =
--                llvm::CastInst::Create(cast->getOpcode(), vo, cast->getType(), LLVMGetName(vo, "_cast"), insertBefore);
-+            *variableOffset = llvm::CastInst::Create(cast->getOpcode(), vo, cast->getType(),
-+                                                     llvm::Twine(vo->getName()) + "_cast", insertBefore);
-         return;
-     }
- 
-@@ -1608,16 +1610,18 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-             else if (c1 == NULL || llvm::isa<llvm::ConstantAggregateZero>(c1))
-                 *constOffset = c0;
-             else
--                *constOffset = llvm::BinaryOperator::Create(llvm::Instruction::Add, c0, c1, LLVMGetName("add", c0, c1),
--                                                            insertBefore);
-+                *constOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Add, c0, c1, ((llvm::Twine("add_") + c0->getName()) + "_") + c1->getName(),
-+                    insertBefore);
- 
-             if (v0 == NULL || llvm::isa<llvm::ConstantAggregateZero>(v0))
-                 *variableOffset = v1;
-             else if (v1 == NULL || llvm::isa<llvm::ConstantAggregateZero>(v1))
-                 *variableOffset = v0;
-             else
--                *variableOffset = llvm::BinaryOperator::Create(llvm::Instruction::Add, v0, v1,
--                                                               LLVMGetName("add", v0, v1), insertBefore);
-+                *variableOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Add, v0, v1, ((llvm::Twine("add_") + v0->getName()) + "_") + v1->getName(),
-+                    insertBefore);
-             return;
-         } else if (bop->getOpcode() == llvm::Instruction::Shl) {
-             lExtractConstantOffset(op0, &c0, &v0, insertBefore);
-@@ -1633,10 +1637,12 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-                 *constOffset = vec;
-                 *variableOffset = NULL;
-             } else {
--                *constOffset = llvm::BinaryOperator::Create(llvm::Instruction::Shl, c0, c1, LLVMGetName("shl", c0, c1),
--                                                            insertBefore);
--                *variableOffset = llvm::BinaryOperator::Create(llvm::Instruction::Shl, v0, c1,
--                                                               LLVMGetName("shl", v0, c1), insertBefore);
-+                *constOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Shl, c0, c1, ((llvm::Twine("shl_") + c0->getName()) + "_") + c1->getName(),
-+                    insertBefore);
-+                *variableOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Shl, v0, c1, ((llvm::Twine("shl_") + v0->getName()) + "_") + c1->getName(),
-+                    insertBefore);
-             }
-             return;
-         } else if (bop->getOpcode() == llvm::Instruction::Mul) {
-@@ -1648,25 +1654,30 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-             // Note that the first term is a constant and the last three are
-             // variable.
-             if (c0 != NULL && c1 != NULL)
--                *constOffset = llvm::BinaryOperator::Create(llvm::Instruction::Mul, c0, c1, LLVMGetName("mul", c0, c1),
--                                                            insertBefore);
-+                *constOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Mul, c0, c1, ((llvm::Twine("mul_") + c0->getName()) + "_") + c1->getName(),
-+                    insertBefore);
-             else
-                 *constOffset = NULL;
- 
-             llvm::Value *va = NULL, *vb = NULL, *vc = NULL;
-             if (v0 != NULL && c1 != NULL)
--                va = llvm::BinaryOperator::Create(llvm::Instruction::Mul, v0, c1, LLVMGetName("mul", v0, c1),
-+                va = llvm::BinaryOperator::Create(llvm::Instruction::Mul, v0, c1,
-+                                                  ((llvm::Twine("mul_") + v0->getName()) + "_") + c1->getName(),
-                                                   insertBefore);
-             if (c0 != NULL && v1 != NULL)
--                vb = llvm::BinaryOperator::Create(llvm::Instruction::Mul, c0, v1, LLVMGetName("mul", c0, v1),
-+                vb = llvm::BinaryOperator::Create(llvm::Instruction::Mul, c0, v1,
-+                                                  ((llvm::Twine("mul_") + c0->getName()) + "_") + v1->getName(),
-                                                   insertBefore);
-             if (v0 != NULL && v1 != NULL)
--                vc = llvm::BinaryOperator::Create(llvm::Instruction::Mul, v0, v1, LLVMGetName("mul", v0, v1),
-+                vc = llvm::BinaryOperator::Create(llvm::Instruction::Mul, v0, v1,
-+                                                  ((llvm::Twine("mul_") + v0->getName()) + "_") + v1->getName(),
-                                                   insertBefore);
- 
-             llvm::Value *vab = NULL;
-             if (va != NULL && vb != NULL)
--                vab = llvm::BinaryOperator::Create(llvm::Instruction::Add, va, vb, LLVMGetName("add", va, vb),
-+                vab = llvm::BinaryOperator::Create(llvm::Instruction::Add, va, vb,
-+                                                   ((llvm::Twine("add_") + va->getName()) + "_") + vb->getName(),
-                                                    insertBefore);
-             else if (va != NULL)
-                 vab = va;
-@@ -1674,8 +1685,9 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-                 vab = vb;
- 
-             if (vab != NULL && vc != NULL)
--                *variableOffset = llvm::BinaryOperator::Create(llvm::Instruction::Add, vab, vc,
--                                                               LLVMGetName("add", vab, vc), insertBefore);
-+                *variableOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Add, vab, vc, ((llvm::Twine("add_") + vab->getName()) + "_") + vc->getName(),
-+                    insertBefore);
-             else if (vab != NULL)
-                 *variableOffset = vab;
-             else
-@@ -1943,7 +1955,7 @@ static bool lOffsets32BitSafe(llvm::Value **variableOffsetPtr, llvm::Value **con
-             // all zeros (i.e. a ConstantAggregateZero, but just in case,
-             // do the more general check with lVectorIs32BitInts().
-             variableOffset = new llvm::TruncInst(variableOffset, LLVMTypes::Int32VectorType,
--                                                 LLVMGetName(variableOffset, "_trunc"), insertBefore);
-+                                                 llvm::Twine(variableOffset->getName()) + "_trunc", insertBefore);
-         else
-             return false;
-     }
-@@ -1952,7 +1964,7 @@ static bool lOffsets32BitSafe(llvm::Value **variableOffsetPtr, llvm::Value **con
-         if (lVectorIs32BitInts(constOffset)) {
-             // Truncate them so we have a 32-bit vector type for them.
-             constOffset = new llvm::TruncInst(constOffset, LLVMTypes::Int32VectorType,
--                                              LLVMGetName(constOffset, "_trunc"), insertBefore);
-+                                              llvm::Twine(constOffset->getName()) + "_trunc", insertBefore);
-         } else {
-             // FIXME: otherwise we just assume that all constant offsets
-             // can actually always fit into 32-bits...  (This could be
-@@ -1963,7 +1975,7 @@ static bool lOffsets32BitSafe(llvm::Value **variableOffsetPtr, llvm::Value **con
-             // llvm::ConstantFoldInstruction() doesn't seem to be doing
-             // enough for us in some cases if we call it from here.
-             constOffset = new llvm::TruncInst(constOffset, LLVMTypes::Int32VectorType,
--                                              LLVMGetName(constOffset, "_trunc"), insertBefore);
-+                                              llvm::Twine(constOffset->getName()) + "_trunc", insertBefore);
-         }
-     }
- 
-@@ -2012,8 +2024,8 @@ static bool lOffsets32BitSafe(llvm::Value **offsetPtr, llvm::Instruction *insert
- 
-         // Alternatively, offset could be a sequence of adds terminating
-         // in safe constant vectors or a SExt.
--        *offsetPtr =
--            new llvm::TruncInst(offset, LLVMTypes::Int32VectorType, LLVMGetName(offset, "_trunc"), insertBefore);
-+        *offsetPtr = new llvm::TruncInst(offset, LLVMTypes::Int32VectorType, llvm::Twine(offset->getName()) + "_trunc",
-+                                         insertBefore);
-         return true;
-     } else
-         return false;
-@@ -2229,7 +2241,8 @@ static bool lGSToGSBaseOffsets(llvm::CallInst *callInst) {
-     }
-     // Cast the base pointer to a void *, since that's what the
-     // __pseudo_*_base_offsets_* functions want.
--    basePtr = new llvm::IntToPtrInst(basePtr, LLVMTypes::VoidPointerType, LLVMGetName(basePtr, "_2void"), callInst);
-+    basePtr = new llvm::IntToPtrInst(basePtr, LLVMTypes::VoidPointerType, llvm::Twine(basePtr->getName()) + "_2void",
-+                                     callInst);
-     lCopyMetadata(basePtr, callInst);
-     llvm::Function *gatherScatterFunc = info->baseOffsetsFunc;
- 
-@@ -2803,7 +2816,7 @@ static bool lGSToLoadStore(llvm::CallInst *callInst) {
-                 lCopyMetadata(ptr, callInst);
-                 Debug(pos, "Transformed gather to unaligned vector load!");
-                 llvm::Instruction *newCall =
--                    lCallInst(gatherInfo->loadMaskedFunc, ptr, mask, LLVMGetName(ptr, "_masked_load"));
-+                    lCallInst(gatherInfo->loadMaskedFunc, ptr, mask, llvm::Twine(ptr->getName()) + "_masked_load");
-                 lCopyMetadata(newCall, callInst);
-                 llvm::ReplaceInstWithInst(callInst, newCall);
-                 return true;
diff --git a/srcpkgs/ispc/patches/llvm12-004.patch b/srcpkgs/ispc/patches/llvm12-004.patch
deleted file mode 100644
index 3a94d8443a5e..000000000000
--- a/srcpkgs/ispc/patches/llvm12-004.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From c03a5142444476a1caa5c2ba7fa2d92d7793d6f1 Mon Sep 17 00:00:00 2001
-From: Deepak Rajendrakumaran <deepak.rajendrakumaran@intel.com>
-Date: Mon, 25 Jan 2021 09:22:49 -0800
-Subject: [PATCH] Fixing build on llvm trunk.
-
----
- src/ctx.cpp | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index ded524b71..b60e6fe84 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1020,8 +1020,7 @@ void FunctionEmitContext::EmitCaseLabel(int value, bool checkMask, SourcePos pos
-     llvm::BasicBlock *bbCaseImpl = NULL;
-     if (emitGenXHardwareMask()) {
-         // Create basic block with actual case implementation
--        llvm::Twine bbName = llvm::Twine(bbCase->getName()) + "_impl";
--        bbCaseImpl = CreateBasicBlock(bbName, bbCase);
-+        bbCaseImpl = CreateBasicBlock(llvm::Twine(bbCase->getName()) + "_impl", bbCase);
-     }
- #endif
- 
-@@ -3142,8 +3141,8 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
-     llvm::Value *undef2 = llvm::UndefValue::get(vecType);
- 
-     // InsertElement
--    llvm::Twine tw = name.isTriviallyEmpty() ? (llvm::Twine(v->getName()) + "_broadcast") : name + llvm::Twine("_init");
--    llvm::Value *insert = InsertInst(undef1, v, 0, tw.str().c_str());
-+    llvm::Value *insert =
-+        InsertInst(undef1, v, 0, name.isTriviallyEmpty() ? (llvm::Twine(v->getName()) + "_broadcast") : name + "_init");
- 
-     // ShuffleVector
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
diff --git a/srcpkgs/ispc/patches/llvm12-005.patch b/srcpkgs/ispc/patches/llvm12-005.patch
deleted file mode 100644
index e3e96b00abfa..000000000000
--- a/srcpkgs/ispc/patches/llvm12-005.patch
+++ /dev/null
@@ -1,372 +0,0 @@
-From c1d0a51bf8416d42144de9e2bdd59825eaeff1ac Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Fri, 8 Jan 2021 14:13:49 -0800
-Subject: [PATCH] LLVM 11 support for gen code
-
----
- src/ctx.cpp                     |  13 ++-
- src/gen/GlobalsLocalization.cpp |   9 +-
- src/opt.cpp                     | 143 ++++++++++++++++++++++++--------
- 3 files changed, 124 insertions(+), 41 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index b60e6fe84..2a72e6837 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1,5 +1,5 @@
- /*
--  Copyright (c) 2010-2020, Intel Corporation
-+  Copyright (c) 2010-2021, Intel Corporation
-   All rights reserved.
- 
-   Redistribution and use in source and binary forms, with or without
-@@ -3685,8 +3685,17 @@ llvm::Value *FunctionEmitContext::GenXSimdCFPredicate(llvm::Value *value, llvm::
-     AssertPos(currentPos, llvm::isa<llvm::VectorType>(value->getType()));
-     llvm::VectorType *vt = llvm::dyn_cast<llvm::VectorType>(value->getType());
-     if (defaults == NULL) {
--        defaults = llvm::ConstantVector::getSplat(value->getType()->getVectorNumElements(),
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-+        defaults = llvm::ConstantVector::getSplat(vt->getVectorNumElements(),
-+                                                  llvm::Constant::getNullValue(vt->getElementType()));
-+#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+        defaults = llvm::ConstantVector::getSplat({static_cast<unsigned int>(vt->getNumElements()), false},
-                                                   llvm::Constant::getNullValue(vt->getElementType()));
-+#else
-+        defaults = llvm::ConstantVector::getSplat(
-+            llvm::ElementCount::get(static_cast<unsigned int>(vt->getNumElements()), false),
-+            llvm::Constant::getNullValue(vt->getElementType()));
-+#endif
-     }
- 
-     auto Fn = llvm::GenXIntrinsic::getGenXDeclaration(m->module, llvm::GenXIntrinsic::genx_simdcf_predicate,
-diff --git a/src/gen/GlobalsLocalization.cpp b/src/gen/GlobalsLocalization.cpp
-index a176e9462..41f3b00e2 100644
---- a/src/gen/GlobalsLocalization.cpp
-+++ b/src/gen/GlobalsLocalization.cpp
-@@ -1,5 +1,5 @@
- /*
--  Copyright (c) 2014, 2016-2020, Intel Corporation
-+  Copyright (c) 2014, 2016-2021, Intel Corporation
-   All rights reserved.
- 
-   Redistribution and use in source and binary forms, with or without
-@@ -53,8 +53,10 @@
- #include <llvm/GenXIntrinsics/GenXIntrOpts.h>
- #include <llvm/GenXIntrinsics/GenXIntrinsics.h>
- #include <llvm/GenXIntrinsics/GenXMetadata.h>
--#include <llvm/IR/CFG.h>
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
- #include <llvm/IR/CallSite.h>
-+#endif
-+#include <llvm/IR/CFG.h>
- #include <llvm/IR/DebugInfo.h>
- #include <llvm/IR/Dominators.h>
- #include <llvm/IR/Function.h>
-@@ -470,7 +472,8 @@ void GlobalsLocalization::LocalizeGlobals(LocalizationInfo &LI) {
-         Instruction &FirstI = *Fn->getEntryBlock().begin();
-         Type *ElemTy = GV->getType()->getElementType();
-         AllocaInst *Alloca = new AllocaInst(ElemTy, 0, GV->getName() + ".local", &FirstI);
--        Alloca->setAlignment(llvm::MaybeAlign(GV->getAlignment()));
-+        Alloca->setAlignment(llvm::MaybeAlign(GV->getAlignment()).valueOrOne());
-+
-         if (!isa<UndefValue>(GV->getInitializer()))
-             new StoreInst(GV->getInitializer(), Alloca, &FirstI);
- 
-diff --git a/src/opt.cpp b/src/opt.cpp
-index d58d77f73..1789b8476 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -2899,15 +2899,17 @@ static llvm::Function *lGenXMaskedInt8Inst(llvm::Instruction *inst, bool isStore
- static llvm::CallInst *lGenXStoreInst(llvm::Value *val, llvm::Value *ptr, llvm::Instruction *inst) {
-     Assert(g->target->isGenXTarget());
-     Assert(llvm::isa<llvm::VectorType>(val->getType()));
--    Assert(llvm::isPowerOf2_32(val->getType()->getVectorNumElements()));
--    Assert(val->getType()->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
-+
-+    llvm::VectorType *valVecType = llvm::dyn_cast<llvm::VectorType>(val->getType());
-+    Assert(llvm::isPowerOf2_32(valVecType->getNumElements()));
-+    Assert(valVecType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
- 
-     // The data write of svm store must have a size that is a power of two from 16 to 128
-     // bytes. However for int8 type and simd width = 8, the data write size is 8.
-     // So we use masked store function here instead of svm store which process int8 type
-     // correctly.
--    if (val->getType()->getPrimitiveSizeInBits() / 8 < 16) {
--        Assert(val->getType()->getScalarType() == LLVMTypes::Int8Type);
-+    if (valVecType->getPrimitiveSizeInBits() / 8 < 16) {
-+        Assert(valVecType->getScalarType() == LLVMTypes::Int8Type);
-         if (llvm::Function *maskedFunc = lGenXMaskedInt8Inst(inst, true))
-             return llvm::dyn_cast<llvm::CallInst>(lCallInst(maskedFunc, ptr, val, LLVMMaskAllOn, ""));
-         else {
-@@ -2923,15 +2925,17 @@ static llvm::CallInst *lGenXStoreInst(llvm::Value *val, llvm::Value *ptr, llvm::
- 
- static llvm::CallInst *lGenXLoadInst(llvm::Value *ptr, llvm::Type *retType, llvm::Instruction *inst) {
-     Assert(llvm::isa<llvm::VectorType>(retType));
--    Assert(llvm::isPowerOf2_32(retType->getVectorNumElements()));
--    Assert(retType->getPrimitiveSizeInBits());
--    Assert(retType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
-+
-+    llvm::VectorType *retVecType = llvm::dyn_cast<llvm::VectorType>(retType);
-+    Assert(llvm::isPowerOf2_32(retVecType->getNumElements()));
-+    Assert(retVecType->getPrimitiveSizeInBits());
-+    Assert(retVecType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
-     // The data read of svm load must have a size that is a power of two from 16 to 128
-     // bytes. However for int8 type and simd width = 8, the data read size is 8.
-     // So we use masked load function here instead of svm load which process int8 type
-     // correctly.
--    if (retType->getPrimitiveSizeInBits() / 8 < 16) {
--        Assert(retType->getScalarType() == LLVMTypes::Int8Type);
-+    if (retVecType->getPrimitiveSizeInBits() / 8 < 16) {
-+        Assert(retVecType->getScalarType() == LLVMTypes::Int8Type);
-         if (llvm::Function *maskedFunc = lGenXMaskedInt8Inst(inst, false))
-             return llvm::dyn_cast<llvm::CallInst>(lCallInst(maskedFunc, ptr, LLVMMaskAllOn, ""));
-         else {
-@@ -5622,15 +5626,24 @@ static bool lVectorizeGEPs(llvm::Value *ptr, std::vector<PtrUse> &ptrUses, std::
-         llvm::PtrToIntInst *ptrToInt =
-             new llvm::PtrToIntInst(ptr, LLVMTypes::Int64Type, "vectorized_ptrtoint", insertBefore);
-         llvm::Instruction *addr = llvm::BinaryOperator::CreateAdd(ptrToInt, offset, "vectorized_address", insertBefore);
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+        llvm::Type *retType = llvm::FixedVectorType::get(scalar_type, reqSize / t_size);
-+#else
-         llvm::Type *retType = llvm::VectorType::get(scalar_type, reqSize / t_size);
-+#endif
-         llvm::Function *fn = llvm::GenXIntrinsic::getGenXDeclaration(
-             m->module, llvm::GenXIntrinsic::genx_svm_block_ld_unaligned, {retType, addr->getType()});
-         llvm::Instruction *ld = llvm::CallInst::Create(fn, {addr}, "vectorized_ld", insertBefore);
- 
-         if (loadingPtr) {
-             // Cast int to ptr via inttoptr
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+            ld = new llvm::IntToPtrInst(ld, llvm::FixedVectorType::get(originalType, reqSize / t_size),
-+                                        "vectorized_inttoptr", insertBefore);
-+#else
-             ld = new llvm::IntToPtrInst(ld, llvm::VectorType::get(originalType, reqSize / t_size),
-                                         "vectorized_inttoptr", insertBefore);
-+#endif
-         }
- 
-         // Scalar extracts for all loaded elements
-@@ -6160,19 +6173,34 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
-         llvm::Instruction *inst = &*I;
-         if (llvm::CallInst *ci = llvm::dyn_cast<llvm::CallInst>(inst)) {
-             llvm::Function *func = ci->getCalledFunction();
--            if (func && func->getName() == "llvm.trap") {
-+            if (func && func->getName().equals("llvm.trap")) {
-                 llvm::Type *argTypes[] = {LLVMTypes::Int1VectorType, LLVMTypes::Int16VectorType};
-                 // Description of parameters for genx_raw_send_noresult can be found in target-genx.ll
-                 auto Fn = +llvm::GenXIntrinsic::getGenXDeclaration(
-                     m->module, llvm::GenXIntrinsic::genx_raw_send_noresult, argTypes);
-                 llvm::SmallVector<llvm::Value *, 8> Args;
-                 Args.push_back(llvm::ConstantInt::get(LLVMTypes::Int32Type, 0));
--                Args.push_back(llvm::ConstantVector::getSplat(g->target->getNativeVectorWidth(),
--                                                              llvm::ConstantInt::getTrue(*g->ctx)));
-+                Args.push_back(llvm::ConstantVector::getSplat(
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-+                    g->target->getNativeVectorWidth(),
-+#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+                    {static_cast<unsigned int>(g->target->getNativeVectorWidth()), false},
-+#else // LLVM 12.0+
-+                    llvm::ElementCount::get(static_cast<unsigned int>(g->target->getNativeVectorWidth()), false),
-+#endif
-+                    llvm::ConstantInt::getTrue(*g->ctx)));
-+
-                 Args.push_back(llvm::ConstantInt::get(LLVMTypes::Int32Type, 39));
-                 Args.push_back(llvm::ConstantInt::get(LLVMTypes::Int32Type, 33554448));
-                 llvm::Value *zeroMask = llvm::ConstantVector::getSplat(
--                    g->target->getNativeVectorWidth(), llvm::Constant::getNullValue(llvm::Type::getInt16Ty(*g->ctx)));
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-+                    g->target->getNativeVectorWidth(),
-+#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+                    {static_cast<unsigned int>(g->target->getNativeVectorWidth()), false},
-+#else // LLVM 12.0+
-+                    llvm::ElementCount::get(static_cast<unsigned int>(g->target->getNativeVectorWidth()), false),
-+#endif
-+                    llvm::Constant::getNullValue(llvm::Type::getInt16Ty(*g->ctx)));
-                 Args.push_back(zeroMask);
- 
-                 llvm::Instruction *newInst = llvm::CallInst::Create(Fn, Args, ci->getName());
-@@ -6181,7 +6209,7 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
-                     modifiedAny = true;
-                     goto restart;
-                 }
--            } else if (func && func->getName() == "llvm.assume") {
-+            } else if (func && func->getName().equals("llvm.assume")) {
-                 ci->eraseFromParent();
-                 modifiedAny = true;
-                 goto restart;
-@@ -6335,7 +6363,7 @@ bool CheckUnsupportedInsts::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 continue;
-             for (int i = 0; i < unsupportedFuncs.size(); i++) {
-                 std::smatch match;
--                std::string funcName = func->getName();
-+                std::string funcName = func->getName().str();
-                 if (std::regex_match(funcName, match, unsupportedFuncs[i])) {
-                     // We found unsupported function. Generate error and stop compilation.
-                     SourcePos pos;
-@@ -6418,12 +6446,14 @@ bool MangleOpenCLBuiltins::runOnBasicBlock(llvm::BasicBlock &bb) {
-             if (func->getName().startswith("__spirv_ocl")) {
-                 std::string mangledName;
-                 llvm::Type *retType = func->getReturnType();
--                std::string funcName = func->getName();
-+                std::string funcName = func->getName().str();
-                 std::vector<llvm::Type *> ArgTy;
-                 // spirv OpenCL builtins are used for double types only
--                Assert(retType->isVectorTy() && retType->getVectorElementType()->isDoubleTy() ||
-+                Assert(retType->isVectorTy() &&
-+                           llvm::dyn_cast<llvm::VectorType>(retType)->getElementType()->isDoubleTy() ||
-                        retType->isSingleValueType() && retType->isDoubleTy());
--                if (retType->isVectorTy() && retType->getVectorElementType()->isDoubleTy()) {
-+                if (retType->isVectorTy() &&
-+                    llvm::dyn_cast<llvm::VectorType>(retType)->getElementType()->isDoubleTy()) {
-                     ArgTy.push_back(LLVMTypes::DoubleVectorType);
-                     // _DvWIDTH suffix is used in target file to differentiate scalar
-                     // and vector versions of intrinsics. Here we remove this
-@@ -6511,8 +6541,15 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
- 
-     // Cast offsets to int64
-     Offsets = new llvm::ZExtInst(
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+        Offsets,
-+        llvm::FixedVectorType::get(LLVMTypes::Int64Type,
-+                                   llvm::dyn_cast<llvm::VectorType>(Offsets->getType())->getNumElements()),
-+        "svm_offset_zext", InsertBefore);
-+#else
-         Offsets, llvm::VectorType::get(LLVMTypes::Int64Type, Offsets->getType()->getVectorNumElements()),
-         "svm_offset_zext", InsertBefore);
-+#endif
- 
-     if (!llvm::isa<llvm::ConstantPointerNull>(Ptr)) {
-         // Cast ptr to int64
-@@ -6520,13 +6557,31 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
- 
-         // Vectorize ptr
-         llvm::Value *undefInsertValue =
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+            llvm::UndefValue::get(llvm::FixedVectorType::get(
-+                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements()));
-+#else
-             llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int64Type, addressType->getVectorNumElements()));
-+#endif
-         address = llvm::InsertElementInst::Create(undefInsertValue, address, LLVMInt32(0), "svm_ptr_iei", InsertBefore);
-         llvm::Constant *zeroVec = llvm::ConstantVector::getSplat(
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-             addressType->getVectorNumElements(),
-+#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+            {llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements(), false},
-+#else
-+        llvm::ElementCount::get(
-+                                llvm::dyn_cast<llvm::FixedVectorType>(addressType->getNumElements(), false),
-+#endif
-             llvm::Constant::getNullValue(llvm::Type::getInt32Ty(InsertBefore->getContext())));
-+
-         llvm::Value *undefShuffleValue =
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+            llvm::UndefValue::get(llvm::FixedVectorType::get(
-+                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements()));
-+#else
-             llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int64Type, addressType->getVectorNumElements()));
-+#endif
-         address = new llvm::ShuffleVectorInst(address, undefShuffleValue, zeroVec, "svm_ptr_svi", InsertBefore);
- 
-         // Calculate address
-@@ -6553,9 +6608,12 @@ llvm::Instruction *FixAddressSpace::processVectorLoad(llvm::LoadInst *LI) {
-     if (retType->getScalarType()->isPointerTy()) {
-         isPtrLoad = true;
-         auto scalarType = g->target->is32Bit() ? LLVMTypes::Int32Type : LLVMTypes::Int64Type;
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+        retType = llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::VectorType>(retType)->getNumElements());
-+#else
-         retType = llvm::VectorType::get(scalarType, retType->getVectorNumElements());
-+#endif
-     }
--
-     llvm::Instruction *res = lGenXLoadInst(ptr, retType, llvm::dyn_cast<llvm::Instruction>(LI));
-     Assert(res);
- 
-@@ -6580,11 +6638,16 @@ llvm::Instruction *FixAddressSpace::processSVMVectorLoad(llvm::Instruction *CI)
-     ptr = new llvm::IntToPtrInst(ptr, llvm::PointerType::get(retType, 0), CI->getName() + "_inttoptr", CI);
-     llvm::Instruction *loadInst = NULL;
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--    loadInst = new llvm::LoadInst(llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(), loadInst,
--                                  CI->getName(), (llvm::Instruction *)NULL);
-+    loadInst = new llvm::LoadInst(llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(), ptr,
-+                                  CI->getName(), false /* not volatile */,
-+                                  llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne(),
-+                                  (llvm::Instruction *)NULL);
- #else
--    loadInst = new llvm::LoadInst(ptr, CI->getName(), (llvm::Instruction *)NULL);
-+    loadInst = new llvm::LoadInst(ptr, CI->getName(), false,
-+                                  llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne(),
-+                                  (llvm::Instruction *)NULL);
- #endif
-+
-     Assert(loadInst);
-     return loadInst;
- }
-@@ -6606,7 +6669,11 @@ llvm::Instruction *FixAddressSpace::processVectorStore(llvm::StoreInst *SI) {
-     // Note: it doesn't look like a normal case for GenX target
-     if (valType->getScalarType()->isPointerTy()) {
-         auto scalarType = g->target->is32Bit() ? LLVMTypes::Int32Type : LLVMTypes::Int64Type;
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+        valType = llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::VectorType>(valType)->getNumElements());
-+#else
-         valType = llvm::VectorType::get(scalarType, valType->getVectorNumElements());
-+#endif
-         val = new llvm::PtrToIntInst(val, valType, "svm_st_val_ptrtoint", SI);
-     }
- 
-@@ -6631,12 +6698,8 @@ llvm::Instruction *FixAddressSpace::processSVMVectorStore(llvm::Instruction *CI)
-     ptr = new llvm::IntToPtrInst(ptr, llvm::PointerType::get(valType, 0), CI->getName() + "_inttoptr", CI);
- 
-     llvm::Instruction *storeInst = NULL;
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--    loadInst = new llvm::StoreInst(val, llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(),
--                                   storeInst, CI->getName(), (llvm::Instruction *)NULL);
--#else
--    storeInst = new llvm::StoreInst(val, ptr, (llvm::Instruction *)NULL);
--#endif
-+    storeInst = new llvm::StoreInst(val, ptr, (llvm::Instruction *)NULL,
-+                                    llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne());
-     Assert(storeInst);
-     return storeInst;
- }
-@@ -6645,15 +6708,18 @@ llvm::Instruction *FixAddressSpace::createInt8WrRegion(llvm::Value *Val, llvm::V
-     int width = g->target->getVectorWidth();
- 
-     llvm::Value *Args[8];
--
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    Args[0] = llvm::UndefValue::get(llvm::FixedVectorType::get(LLVMTypes::Int8Type, width * 4)); // old value
-+#else
-     Args[0] = llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int8Type, width * 4)); // old value
--    Args[1] = Val;                                                                          // value to store
--    Args[2] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 0);                              // vstride
--    Args[3] = llvm::ConstantInt::get(LLVMTypes::Int32Type, width);                          // width
--    Args[4] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 4);                              // stride
--    Args[5] = llvm::ConstantInt::get(LLVMTypes::Int16Type, 0);                              // offsets
--    Args[6] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 0);                              // parent width (ignored)
--    Args[7] = Mask;                                                                         // mask
-+#endif
-+    Args[1] = Val;                                                 // value to store
-+    Args[2] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 0);     // vstride
-+    Args[3] = llvm::ConstantInt::get(LLVMTypes::Int32Type, width); // width
-+    Args[4] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 4);     // stride
-+    Args[5] = llvm::ConstantInt::get(LLVMTypes::Int16Type, 0);     // offsets
-+    Args[6] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 0);     // parent width (ignored)
-+    Args[7] = Mask;                                                // mask
- 
-     llvm::Type *Tys[4];
- 
-@@ -6708,7 +6774,12 @@ llvm::Instruction *FixAddressSpace::processGatherScatterPrivate(llvm::CallInst *
-         return NULL;
- 
-     llvm::Value *address = calculateGatherScatterAddress(ptr, offsets, CI);
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    llvm::Type *i8VecType = llvm::FixedVectorType::get(LLVMTypes::Int8Type, width * 4);
-+#else
-     llvm::Type *i8VecType = llvm::VectorType::get(LLVMTypes::Int8Type, width * 4);
-+#endif
-+
-     bool isInt8 = (value->getType()->getScalarType() == LLVMTypes::Int8Type);
- 
-     Assert(address && "Bad gather/scatter address!");
diff --git a/srcpkgs/ispc/patches/llvm12-006.patch b/srcpkgs/ispc/patches/llvm12-006.patch
deleted file mode 100644
index a829ea48391e..000000000000
--- a/srcpkgs/ispc/patches/llvm12-006.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From bb3f493d1fbd45c79e1d9dee67a0430ba313eaad Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Tue, 19 Jan 2021 11:07:33 -0800
-Subject: [PATCH] Fixed ifdefs for LLVM_11
-
----
- src/ctx.cpp |  6 +++---
- src/opt.cpp | 18 +++++++++---------
- 2 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 2a72e6837..527a02f30 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1691,7 +1691,7 @@ llvm::Value *FunctionEmitContext::SmearUniform(llvm::Value *value, const llvm::T
-     if (llvm::Constant *const_val = llvm::dyn_cast<llvm::Constant>(value)) {
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-         ret = llvm::ConstantVector::getSplat(g->target->getVectorWidth(), const_val);
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-         ret =
-             llvm::ConstantVector::getSplat({static_cast<unsigned int>(g->target->getVectorWidth()), false}, const_val);
- #else // LLVM 12.0+
-@@ -3148,7 +3148,7 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-     llvm::Constant *zeroVec = llvm::ConstantVector::getSplat(
-         vecType->getVectorNumElements(), llvm::Constant::getNullValue(llvm::Type::getInt32Ty(*g->ctx)));
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-     llvm::Constant *zeroVec =
-         llvm::ConstantVector::getSplat({static_cast<unsigned int>(ty->getNumElements()), false},
-                                        llvm::Constant::getNullValue(llvm::Type::getInt32Ty(*g->ctx)));
-@@ -3688,7 +3688,7 @@ llvm::Value *FunctionEmitContext::GenXSimdCFPredicate(llvm::Value *value, llvm::
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-         defaults = llvm::ConstantVector::getSplat(vt->getVectorNumElements(),
-                                                   llvm::Constant::getNullValue(vt->getElementType()));
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-         defaults = llvm::ConstantVector::getSplat({static_cast<unsigned int>(vt->getNumElements()), false},
-                                                   llvm::Constant::getNullValue(vt->getElementType()));
- #else
-diff --git a/src/opt.cpp b/src/opt.cpp
-index 1789b8476..3ff191a0a 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -1045,7 +1045,7 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                     align = g->target->getNativeVectorAlignment();
-                 else
-                     align = callInst->getCalledFunction() == avxMaskedLoad32 ? 4 : 8;
--#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                 llvm::Instruction *loadInst =
-                     new llvm::LoadInst(castPtr, llvm::Twine(callInst->getArgOperand(0)->getName()) + "_load",
-                                        false /* not volatile */, llvm::MaybeAlign(align), (llvm::Instruction *)NULL);
-@@ -1472,7 +1472,7 @@ static llvm::Value *lGetBasePtrAndOffsets(llvm::Value *ptrs, llvm::Value **offse
-                     llvm::Value *zeroMask =
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                         llvm::ConstantVector::getSplat(cv->getType()->getVectorNumElements(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                         llvm::ConstantVector::getSplat(
-                             {llvm::dyn_cast<llvm::VectorType>(cv->getType())->getNumElements(), false},
- #else // LLVM 12.0+
-@@ -1495,7 +1495,7 @@ static llvm::Value *lGetBasePtrAndOffsets(llvm::Value *ptrs, llvm::Value **offse
-                         llvm::Value *zeroMask = llvm::ConstantVector::getSplat(
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                             bop_var_type->getVectorNumElements(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                             {llvm::dyn_cast<llvm::VectorType>(bop_var_type)->getNumElements(), false},
- #else // LLVM 12.0+
-                             llvm::ElementCount::get(
-@@ -2803,7 +2803,7 @@ static bool lGSToLoadStore(llvm::CallInst *callInst) {
-             llvm::Value *zeroMask =
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                 llvm::ConstantVector::getSplat(callInst->getType()->getVectorNumElements(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                 llvm::ConstantVector::getSplat(
-                     {llvm::dyn_cast<llvm::VectorType>(callInst->getType())->getNumElements(), false},
- 
-@@ -3100,7 +3100,7 @@ static bool lImproveMaskedLoad(llvm::CallInst *callInst, llvm::BasicBlock::itera
-         {
-             llvm::Type *ptrType = llvm::PointerType::get(callInst->getType(), 0);
-             ptr = new llvm::BitCastInst(ptr, ptrType, "ptr_cast_for_load", callInst);
--#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-             load = new llvm::LoadInst(
-                 ptr, callInst->getName(), false /* not volatile */,
-                 llvm::MaybeAlign(g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align)
-@@ -3459,7 +3459,7 @@ llvm::Value *lGEPAndLoad(llvm::Value *basePtr, int64_t offset, int align, llvm::
-                          llvm::Type *type) {
-     llvm::Value *ptr = lGEPInst(basePtr, LLVMInt64(offset), "new_base", insertBefore);
-     ptr = new llvm::BitCastInst(ptr, llvm::PointerType::get(type, 0), "ptr_cast", insertBefore);
--#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-     return new llvm::LoadInst(ptr, "gather_load", false /* not volatile */, llvm::MaybeAlign(align), insertBefore);
- #else // LLVM 11.0+
-     return new llvm::LoadInst(llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(), ptr,
-@@ -6183,7 +6183,7 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 Args.push_back(llvm::ConstantVector::getSplat(
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                     g->target->getNativeVectorWidth(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                     {static_cast<unsigned int>(g->target->getNativeVectorWidth()), false},
- #else // LLVM 12.0+
-                     llvm::ElementCount::get(static_cast<unsigned int>(g->target->getNativeVectorWidth()), false),
-@@ -6195,7 +6195,7 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 llvm::Value *zeroMask = llvm::ConstantVector::getSplat(
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                     g->target->getNativeVectorWidth(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                     {static_cast<unsigned int>(g->target->getNativeVectorWidth()), false},
- #else // LLVM 12.0+
-                     llvm::ElementCount::get(static_cast<unsigned int>(g->target->getNativeVectorWidth()), false),
-@@ -6567,7 +6567,7 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
-         llvm::Constant *zeroVec = llvm::ConstantVector::getSplat(
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-             addressType->getVectorNumElements(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-             {llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements(), false},
- #else
-         llvm::ElementCount::get(
diff --git a/srcpkgs/ispc/patches/llvm12-007.patch b/srcpkgs/ispc/patches/llvm12-007.patch
deleted file mode 100644
index 1b975f896c7e..000000000000
--- a/srcpkgs/ispc/patches/llvm12-007.patch
+++ /dev/null
@@ -1,160 +0,0 @@
-From 62f5a6c37bf26fc25a7cf81868052d3472874610 Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Tue, 23 Mar 2021 23:07:30 -0700
-Subject: [PATCH] Do not generate function mask when it is not required
-
----
- src/ctx.cpp                    | 39 ++++++++++++++-------
- tests/lit-tests/full_mask.ispc | 63 ++++++++++++++++++++++++++++++++++
- 2 files changed, 90 insertions(+), 12 deletions(-)
- create mode 100644 tests/lit-tests/full_mask.ispc
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 527a02f30..9e775fc5c 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -231,10 +231,18 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym, llvm::F
-     internalMaskPointer = AllocaInst(LLVMTypes::MaskType, "internal_mask_memory");
-     StoreInst(LLVMMaskAllOn, internalMaskPointer);
- 
--    functionMaskValue = LLVMMaskAllOn;
--
--    fullMaskPointer = AllocaInst(LLVMTypes::MaskType, "full_mask_memory");
--    StoreInst(LLVMMaskAllOn, fullMaskPointer);
-+    // If the function doesn't have __mask in parameters, there is no need to
-+    // have function mask
-+    if ((func->GetType()->isExported &&
-+         (lf->getFunctionType()->getNumParams() == func->GetType()->GetNumParameters())) ||
-+        (func->GetType()->isUnmasked) || (func->GetType()->isTask)) {
-+        functionMaskValue = NULL;
-+        fullMaskPointer = NULL;
-+    } else {
-+        functionMaskValue = LLVMMaskAllOn;
-+        fullMaskPointer = AllocaInst(LLVMTypes::MaskType, "full_mask_memory");
-+        StoreInst(LLVMMaskAllOn, fullMaskPointer);
-+    }
- 
-     blockEntryMask = NULL;
-     breakLanesPtr = continueLanesPtr = NULL;
-@@ -389,20 +397,26 @@ llvm::BasicBlock *FunctionEmitContext::GetCurrentBasicBlock() { return bblock; }
- 
- void FunctionEmitContext::SetCurrentBasicBlock(llvm::BasicBlock *bb) { bblock = bb; }
- 
--llvm::Value *FunctionEmitContext::GetFunctionMask() { return functionMaskValue; }
-+llvm::Value *FunctionEmitContext::GetFunctionMask() { return fullMaskPointer ? functionMaskValue : LLVMMaskAllOn; }
- 
- llvm::Value *FunctionEmitContext::GetInternalMask() { return LoadInst(internalMaskPointer, NULL, "load_mask"); }
- 
- llvm::Value *FunctionEmitContext::GetFullMask() {
--    return BinaryOperator(llvm::Instruction::And, GetInternalMask(), functionMaskValue, "internal_mask&function_mask");
-+    return fullMaskPointer ? BinaryOperator(llvm::Instruction::And, GetInternalMask(), functionMaskValue,
-+                                            "internal_mask&function_mask")
-+                           : GetInternalMask();
- }
- 
--llvm::Value *FunctionEmitContext::GetFullMaskPointer() { return fullMaskPointer; }
-+llvm::Value *FunctionEmitContext::GetFullMaskPointer() {
-+    return fullMaskPointer ? fullMaskPointer : internalMaskPointer;
-+}
- 
- void FunctionEmitContext::SetFunctionMask(llvm::Value *value) {
--    functionMaskValue = value;
--    if (bblock != NULL)
--        StoreInst(GetFullMask(), fullMaskPointer);
-+    if (fullMaskPointer != NULL) {
-+        functionMaskValue = value;
-+        if (bblock != NULL)
-+            StoreInst(GetFullMask(), fullMaskPointer);
-+    }
- }
- 
- void FunctionEmitContext::SetBlockEntryMask(llvm::Value *value) { blockEntryMask = value; }
-@@ -410,7 +424,8 @@ void FunctionEmitContext::SetBlockEntryMask(llvm::Value *value) { blockEntryMask
- void FunctionEmitContext::SetInternalMask(llvm::Value *value) {
-     StoreInst(value, internalMaskPointer);
-     // kludge so that __mask returns the right value in ispc code.
--    StoreInst(GetFullMask(), fullMaskPointer);
-+    if (fullMaskPointer)
-+        StoreInst(GetFullMask(), fullMaskPointer);
- }
- 
- void FunctionEmitContext::SetInternalMaskAnd(llvm::Value *oldMask, llvm::Value *test) {
-@@ -1265,7 +1280,7 @@ void FunctionEmitContext::CurrentLanesReturned(Expr *expr, bool doCoherenceCheck
-         // lanes have returned
-         if (doCoherenceCheck) {
-             // if newReturnedLanes == functionMaskValue, get out of here!
--            llvm::Value *cmp = MasksAllEqual(functionMaskValue, newReturnedLanes);
-+            llvm::Value *cmp = MasksAllEqual(GetFunctionMask(), newReturnedLanes);
-             llvm::BasicBlock *bDoReturn = CreateBasicBlock("do_return");
-             llvm::BasicBlock *bNoReturn = CreateBasicBlock("no_return");
-             BranchInst(bDoReturn, bNoReturn, cmp);
-diff --git a/tests/lit-tests/full_mask.ispc b/tests/lit-tests/full_mask.ispc
-new file mode 100644
-index 000000000..ac0b0bca3
---- /dev/null
-+++ b/tests/lit-tests/full_mask.ispc
-@@ -0,0 +1,63 @@
-+// RUN: %{ispc} %s -DISPC_EXPORT --emit-llvm-text -O0 --nowrap -o %t.ll
-+// RUN: FileCheck --input-file=%t.ll -check-prefix=CHECK_ISPC_EXPORT %s
-+
-+// RUN: %{ispc} %s -DISPC_UNMASKED --emit-llvm-text -O0 --nowrap -o %t.ll
-+// RUN: FileCheck --input-file=%t.ll -check-prefix=CHECK_ISPC_UNMASKED %s
-+
-+// RUN: %{ispc} %s -DISPC_NOQUALIF --emit-llvm-text -O0 --nowrap -o %t.ll
-+// RUN: FileCheck --input-file=%t.ll -check-prefix=CHECK_ISPC_NOQUALIF %s
-+
-+// RUN: %{ispc} %s -DISPC_TASK --emit-llvm-text -O0 --nowrap -o %t.ll
-+// RUN: FileCheck --input-file=%t.ll -check-prefix=CHECK_ISPC_TASK %s
-+
-+struct Parameters {
-+    float *vout;
-+    int param;
-+};
-+
-+#ifdef ISPC_EXPORT
-+// CHECK_ISPC_EXPORT: define void @simple_export___
-+// CHECK_ISPC_EXPORT: %full_mask_memory = alloca
-+// CHECK_ISPC_EXPORT: define void @simple_export(
-+// CHECK_ISPC_EXPORT-NOT: %full_mask_memory = alloca
-+export void simple_export(void *uniform _p) {
-+    Parameters *uniform p = (Parameters * uniform) _p;
-+    if (programIndex > p->param)
-+        p->vout[programIndex] = programCount * programIndex;
-+}
-+#endif
-+#ifdef ISPC_UNMASKED
-+// CHECK_ISPC_UNMASKED: define void @simple_unmasked
-+// CHECK_ISPC_UNMASKED-NOT: %full_mask_memory = alloca
-+unmasked void simple_unmasked(void *uniform _p) {
-+    Parameters *uniform p = (Parameters * uniform) _p;
-+    if (programIndex > p->param)
-+        p->vout[programIndex] = programCount * programIndex;
-+}
-+#endif
-+#ifdef ISPC_NOQUALIF
-+// CHECK_ISPC_NOQUALIF: define void @simple
-+// CHECK_ISPC_NOQUALIF: %full_mask_memory = alloca
-+void simple(void *uniform _p) {
-+    Parameters *uniform p = (Parameters * uniform) _p;
-+    if (programIndex > p->param)
-+        p->vout[programIndex] = programCount * programIndex;
-+}
-+#endif
-+#ifdef ISPC_TASK
-+
-+// CHECK_ISPC_TASK: define void @simple_task
-+// CHECK_ISPC_TASK-NOT: %full_mask_memory = alloca
-+// CHECK_ISPC_TASK: define void @simple_entry_point__
-+// CHECK_ISPC_TASK: %full_mask_memory = alloca
-+// CHECK_ISPC_TASK: define void @simple_entry_point(
-+// CHECK_ISPC_TASK-NOT: %full_mask_memory = alloca
-+task void simple_task(void *uniform _p) {
-+    Parameters *uniform p = (Parameters * uniform) _p;
-+    if (programIndex > p->param)
-+        p->vout[programIndex] = programCount * programIndex;
-+}
-+export void simple_entry_point(void *uniform parameters, uniform int dim0, uniform int dim1, uniform int dim2) {
-+    launch[dim0, dim1, dim2] simple_task(parameters);
-+}
-+#endif
-\ No newline at end of file
diff --git a/srcpkgs/ispc/patches/llvm12-008.patch b/srcpkgs/ispc/patches/llvm12-008.patch
deleted file mode 100644
index c8413d8b7887..000000000000
--- a/srcpkgs/ispc/patches/llvm12-008.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-From afad14227d9204a3c8a626ca608f5b43c3218fe9 Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Tue, 4 May 2021 11:43:52 -0700
-Subject: [PATCH] Fixed ISPC gen build for LLVM12
-
----
- src/ctx.cpp |  4 ++++
- src/opt.cpp | 43 +++++++++++++++++++++++++++++--------------
- 2 files changed, 33 insertions(+), 14 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 0c7050591..f7dc06939 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -3738,7 +3738,11 @@ llvm::Value *FunctionEmitContext::GenXSimdCFAny(llvm::Value *value) {
- 
- llvm::Value *FunctionEmitContext::GenXSimdCFPredicate(llvm::Value *value, llvm::Value *defaults) {
-     AssertPos(currentPos, llvm::isa<llvm::VectorType>(value->getType()));
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    llvm::FixedVectorType *vt = llvm::dyn_cast<llvm::FixedVectorType>(value->getType());
-+#else
-     llvm::VectorType *vt = llvm::dyn_cast<llvm::VectorType>(value->getType());
-+#endif
-     if (defaults == NULL) {
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-         defaults = llvm::ConstantVector::getSplat(vt->getVectorNumElements(),
-diff --git a/src/opt.cpp b/src/opt.cpp
-index cea4afa23..4e33d6b1a 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -2916,9 +2916,13 @@ static llvm::Function *lGenXMaskedInt8Inst(llvm::Instruction *inst, bool isStore
- 
- static llvm::CallInst *lGenXStoreInst(llvm::Value *val, llvm::Value *ptr, llvm::Instruction *inst) {
-     Assert(g->target->isGenXTarget());
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    Assert(llvm::isa<llvm::FixedVectorType>(val->getType()));
-+    llvm::FixedVectorType *valVecType = llvm::dyn_cast<llvm::FixedVectorType>(val->getType());
-+#else
-     Assert(llvm::isa<llvm::VectorType>(val->getType()));
--
-     llvm::VectorType *valVecType = llvm::dyn_cast<llvm::VectorType>(val->getType());
-+#endif
-     Assert(llvm::isPowerOf2_32(valVecType->getNumElements()));
-     Assert(valVecType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
- 
-@@ -2942,9 +2946,13 @@ static llvm::CallInst *lGenXStoreInst(llvm::Value *val, llvm::Value *ptr, llvm::
- }
- 
- static llvm::CallInst *lGenXLoadInst(llvm::Value *ptr, llvm::Type *retType, llvm::Instruction *inst) {
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    Assert(llvm::isa<llvm::FixedVectorType>(retType));
-+    llvm::FixedVectorType *retVecType = llvm::dyn_cast<llvm::FixedVectorType>(retType);
-+#else
-     Assert(llvm::isa<llvm::VectorType>(retType));
--
-     llvm::VectorType *retVecType = llvm::dyn_cast<llvm::VectorType>(retType);
-+#endif
-     Assert(llvm::isPowerOf2_32(retVecType->getNumElements()));
-     Assert(retVecType->getPrimitiveSizeInBits());
-     Assert(retVecType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
-@@ -5485,8 +5493,13 @@ static void lCreateBlockLDUse(llvm::Instruction *currInst, std::vector<llvm::Ext
-         } else if (auto gather = lGetPseudoGather(llvm::dyn_cast<llvm::Instruction>(ui->getUser()))) {
-             // Collect idxs from gather and fix users
-             llvm::Value *res = llvm::UndefValue::get(gather->getType());
--            for (unsigned i = 0, end = llvm::dyn_cast<llvm::VectorType>(res->getType())->getNumElements(); i < end;
--                 ++i) {
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+            for (unsigned i = 0, end = llvm::dyn_cast<llvm::FixedVectorType>(res->getType())->getNumElements(); i < end;
-+                 ++i)
-+#else
-+            for (unsigned i = 0, end = llvm::dyn_cast<llvm::VectorType>(res->getType())->getNumElements(); i < end; ++i)
-+#endif
-+            {
-                 // Get element via IEI
-                 res = llvm::InsertElementInst::Create(res, EEIs[ptrUse.idxs[curr_idx++]],
-                                                       llvm::ConstantInt::get(LLVMTypes::Int32Type, i),
-@@ -5522,10 +5535,11 @@ static bool lVectorizeGEPs(llvm::Value *ptr, std::vector<PtrUse> &ptrUses, std::
- 
-     // Adjust values for vector load
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--    if (auto vecTy = llvm::dyn_cast<llvm::FixedVectorType>(type)) {
-+    if (auto vecTy = llvm::dyn_cast<llvm::FixedVectorType>(type))
- #else
--    if (auto vecTy = llvm::dyn_cast<llvm::VectorType>(type)) {
-+    if (auto vecTy = llvm::dyn_cast<llvm::VectorType>(type))
- #endif
-+    {
-         // Get single element size
-         t_size /= vecTy->getNumElements();
-         // Get single element type
-@@ -6477,7 +6491,7 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-         Offsets,
-         llvm::FixedVectorType::get(LLVMTypes::Int64Type,
--                                   llvm::dyn_cast<llvm::VectorType>(Offsets->getType())->getNumElements()),
-+                                   llvm::dyn_cast<llvm::FixedVectorType>(Offsets->getType())->getNumElements()),
-         "svm_offset_zext", InsertBefore);
- #else
-         Offsets, llvm::VectorType::get(LLVMTypes::Int64Type, Offsets->getType()->getVectorNumElements()),
-@@ -6492,7 +6506,7 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
-         llvm::Value *undefInsertValue =
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-             llvm::UndefValue::get(llvm::FixedVectorType::get(
--                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements()));
-+                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::FixedVectorType>(addressType)->getNumElements()));
- #else
-             llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int64Type, addressType->getVectorNumElements()));
- #endif
-@@ -6501,17 +6515,16 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-             addressType->getVectorNumElements(),
- #elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
--            {llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements(), false},
-+            {llvm::dyn_cast<llvm::FixedVectorType>(addressType)->getNumElements(), false},
- #else
--        llvm::ElementCount::get(
--                                llvm::dyn_cast<llvm::FixedVectorType>(addressType->getNumElements(), false),
-+            llvm::ElementCount::get(llvm::dyn_cast<llvm::FixedVectorType>(addressType)->getNumElements(), false),
- #endif
-             llvm::Constant::getNullValue(llvm::Type::getInt32Ty(InsertBefore->getContext())));
- 
-         llvm::Value *undefShuffleValue =
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-             llvm::UndefValue::get(llvm::FixedVectorType::get(
--                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements()));
-+                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::FixedVectorType>(addressType)->getNumElements()));
- #else
-             llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int64Type, addressType->getVectorNumElements()));
- #endif
-@@ -6542,7 +6555,8 @@ llvm::Instruction *FixAddressSpace::processVectorLoad(llvm::LoadInst *LI) {
-         isPtrLoad = true;
-         auto scalarType = g->target->is32Bit() ? LLVMTypes::Int32Type : LLVMTypes::Int64Type;
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--        retType = llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::VectorType>(retType)->getNumElements());
-+        retType =
-+            llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::FixedVectorType>(retType)->getNumElements());
- #else
-         retType = llvm::VectorType::get(scalarType, retType->getVectorNumElements());
- #endif
-@@ -6604,7 +6618,8 @@ llvm::Instruction *FixAddressSpace::processVectorStore(llvm::StoreInst *SI) {
-     if (valType->getScalarType()->isPointerTy()) {
-         auto scalarType = g->target->is32Bit() ? LLVMTypes::Int32Type : LLVMTypes::Int64Type;
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--        valType = llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::VectorType>(valType)->getNumElements());
-+        valType =
-+            llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::FixedVectorType>(valType)->getNumElements());
- #else
-         valType = llvm::VectorType::get(scalarType, valType->getVectorNumElements());
- #endif
diff --git a/srcpkgs/ispc/patches/llvm12-009.patch b/srcpkgs/ispc/patches/llvm12-009.patch
deleted file mode 100644
index d3ea67828582..000000000000
--- a/srcpkgs/ispc/patches/llvm12-009.patch
+++ /dev/null
@@ -1,2109 +0,0 @@
-From 97b13c32132e2704a5e3e7b2eae49d854d087e3e Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Tue, 4 May 2021 11:31:55 -0700
-Subject: [PATCH] Updated builtins-cm* for switch to LLVM12
-
----
- builtins/builtins-cm-32.ll | 234 ++++++++++++++++++-------------------
- builtins/builtins-cm-64.ll | 232 ++++++++++++++++++------------------
- 2 files changed, 233 insertions(+), 233 deletions(-)
-
-diff --git a/builtins/builtins-cm-32.ll b/builtins/builtins-cm-32.ll
-index 32debf32e..481bbdc48 100644
---- a/builtins/builtins-cm-32.ll
-+++ b/builtins/builtins-cm-32.ll
-@@ -557,7 +557,7 @@ $_ZN13VaryingWriter12WriteVecElemIPvEEvv = comdat any
- @.str.10 = private unnamed_addr constant [5 x i8] c"%08X\00", align 1
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i8 @_Z24__cm_intrinsic_impl_sdivcc(i8 signext, i8 signext) #0 {
-+define internal signext i8 @_Z24__cm_intrinsic_impl_sdivcc(i8 signext, i8 signext) #0 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -618,7 +618,7 @@ define internal <1 x i8> @_ZN7details13__impl_divremILi1EEEu2CMvbT__cS1_S1_u2CMv
- declare <1 x i8> @llvm.genx.rdregioni.v1i8.v1i8.i16(<1 x i8>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -634,7 +634,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -680,7 +680,7 @@ define internal <2 x i8> @_ZN7details13__impl_divremILi2EEEu2CMvbT__cS1_S1_u2CMv
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -818,7 +818,7 @@ define internal <16 x i8> @_ZN7details13__impl_divremILi16EEEu2CMvbT__cS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -864,7 +864,7 @@ define internal <32 x i8> @_ZN7details13__impl_divremILi32EEEu2CMvbT__cS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signext) #0 {
-+define internal signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signext) #0 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -890,7 +890,7 @@ define dso_local signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signe
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -904,7 +904,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -918,7 +918,7 @@ define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -932,7 +932,7 @@ define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8 x i8>) #7 {
-+define internal <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8 x i8>) #7 {
-   %3 = alloca <8 x i8>, align 8
-   %4 = alloca <8 x i8>, align 8
-   %5 = alloca <8 x i8>, align 8
-@@ -946,7 +946,7 @@ define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>, <16 x i8>) #9 {
-+define internal <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>, <16 x i8>) #9 {
-   %3 = alloca <16 x i8>, align 16
-   %4 = alloca <16 x i8>, align 16
-   %5 = alloca <16 x i8>, align 16
-@@ -960,7 +960,7 @@ define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -974,7 +974,7 @@ define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i16 @_Z24__cm_intrinsic_impl_sdivss(i16 signext, i16 signext) #3 {
-+define internal signext i16 @_Z24__cm_intrinsic_impl_sdivss(i16 signext, i16 signext) #3 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1058,7 +1058,7 @@ define internal <1 x i16> @_ZN7details13__impl_divremILi1EEEu2CMvbT__sS1_S1_u2CM
- declare <1 x i16> @llvm.genx.rdregioni.v1i16.v1i16.i16(<1 x i16>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1074,7 +1074,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -1143,7 +1143,7 @@ define internal <2 x i16> @_ZN7details13__impl_divremILi2EEEu2CMvbT__sS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -1350,7 +1350,7 @@ define internal <16 x i16> @_ZN7details13__impl_divremILi16EEEu2CMvbT__sS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -1419,7 +1419,7 @@ define internal <32 x i16> @_ZN7details13__impl_divremILi32EEEu2CMvbT__sS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 signext) #3 {
-+define internal signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 signext) #3 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1445,7 +1445,7 @@ define dso_local signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 si
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1459,7 +1459,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -1473,7 +1473,7 @@ define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -1487,7 +1487,7 @@ define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <8 x i16>) #9 {
-+define internal <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <8 x i16>) #9 {
-   %3 = alloca <8 x i16>, align 16
-   %4 = alloca <8 x i16>, align 16
-   %5 = alloca <8 x i16>, align 16
-@@ -1501,7 +1501,7 @@ define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>, <16 x i16>) #11 {
-+define internal <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>, <16 x i16>) #11 {
-   %3 = alloca <16 x i16>, align 32
-   %4 = alloca <16 x i16>, align 32
-   %5 = alloca <16 x i16>, align 32
-@@ -1515,7 +1515,7 @@ define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -1529,7 +1529,7 @@ define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_sdivii(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_sdivii(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -1730,7 +1730,7 @@ define internal <1 x i32> @_ZN7details13__impl_divremILi1EEEu2CMvbT__iS1_S1_u2CM
- declare <1 x i32> @llvm.genx.rdregioni.v1i32.v1i32.i16(<1 x i32>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -1746,7 +1746,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -1932,7 +1932,7 @@ define internal <2 x i32> @_ZN7details13__impl_divremILi2EEEu2CMvbT__iS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -2490,7 +2490,7 @@ define internal <16 x i32> @_ZN7details13__impl_divremILi16EEEu2CMvbT__iS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -2676,7 +2676,7 @@ define internal <32 x i32> @_ZN7details13__impl_divremILi32EEEu2CMvbT__iS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -2702,7 +2702,7 @@ define dso_local i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -2716,7 +2716,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -2730,7 +2730,7 @@ define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -2744,7 +2744,7 @@ define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <8 x i32>) #17 {
-+define internal <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <8 x i32>) #17 {
-   %3 = alloca <8 x i32>, align 32
-   %4 = alloca <8 x i32>, align 32
-   %5 = alloca <8 x i32>, align 32
-@@ -2758,7 +2758,7 @@ define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>, <16 x i32>) #18 {
-+define internal <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>, <16 x i32>) #18 {
-   %3 = alloca <16 x i32>, align 64
-   %4 = alloca <16 x i32>, align 64
-   %5 = alloca <16 x i32>, align 64
-@@ -2772,7 +2772,7 @@ define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -2786,7 +2786,7 @@ define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_udivhh(i8 zeroext, i8 zeroext) #21 {
-+define internal zeroext i8 @_Z24__cm_intrinsic_impl_udivhh(i8 zeroext, i8 zeroext) #21 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -2844,7 +2844,7 @@ define internal <1 x i8> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__hS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -2860,7 +2860,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -2906,7 +2906,7 @@ define internal <2 x i8> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__hS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -3044,7 +3044,7 @@ define internal <16 x i8> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__hS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -3090,7 +3090,7 @@ define internal <32 x i8> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__hS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroext) #21 {
-+define internal zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroext) #21 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -3116,7 +3116,7 @@ define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroe
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -3130,7 +3130,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -3144,7 +3144,7 @@ define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -3158,7 +3158,7 @@ define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8 x i8>) #15 {
-+define internal <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8 x i8>) #15 {
-   %3 = alloca <8 x i8>, align 8
-   %4 = alloca <8 x i8>, align 8
-   %5 = alloca <8 x i8>, align 8
-@@ -3172,7 +3172,7 @@ define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>, <16 x i8>) #16 {
-+define internal <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>, <16 x i8>) #16 {
-   %3 = alloca <16 x i8>, align 16
-   %4 = alloca <16 x i8>, align 16
-   %5 = alloca <16 x i8>, align 16
-@@ -3186,7 +3186,7 @@ define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -3200,7 +3200,7 @@ define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_udivtt(i16 zeroext, i16 zeroext) #22 {
-+define internal zeroext i16 @_Z24__cm_intrinsic_impl_udivtt(i16 zeroext, i16 zeroext) #22 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3278,7 +3278,7 @@ define internal <1 x i16> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__tS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3294,7 +3294,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -3360,7 +3360,7 @@ define internal <2 x i16> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__tS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -3558,7 +3558,7 @@ define internal <16 x i16> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__tS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -3624,7 +3624,7 @@ define internal <32 x i16> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__tS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 zeroext) #22 {
-+define internal zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 zeroext) #22 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3650,7 +3650,7 @@ define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 ze
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3664,7 +3664,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -3678,7 +3678,7 @@ define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -3692,7 +3692,7 @@ define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <8 x i16>) #16 {
-+define internal <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <8 x i16>) #16 {
-   %3 = alloca <8 x i16>, align 16
-   %4 = alloca <8 x i16>, align 16
-   %5 = alloca <8 x i16>, align 16
-@@ -3706,7 +3706,7 @@ define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>, <16 x i16>) #17 {
-+define internal <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>, <16 x i16>) #17 {
-   %3 = alloca <16 x i16>, align 32
-   %4 = alloca <16 x i16>, align 32
-   %5 = alloca <16 x i16>, align 32
-@@ -3720,7 +3720,7 @@ define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -3734,7 +3734,7 @@ define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_udivjj(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_udivjj(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -3892,7 +3892,7 @@ define internal <1 x i32> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__jS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -3908,7 +3908,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -4054,7 +4054,7 @@ define internal <2 x i32> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__jS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -4492,7 +4492,7 @@ define internal <16 x i32> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__jS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -4638,7 +4638,7 @@ define internal <32 x i32> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__jS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -4664,7 +4664,7 @@ define dso_local i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -4678,7 +4678,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -4692,7 +4692,7 @@ define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -4706,7 +4706,7 @@ define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <8 x i32>) #17 {
-+define internal <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <8 x i32>) #17 {
-   %3 = alloca <8 x i32>, align 32
-   %4 = alloca <8 x i32>, align 32
-   %5 = alloca <8 x i32>, align 32
-@@ -4720,7 +4720,7 @@ define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>, <16 x i32>) #18 {
-+define internal <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>, <16 x i32>) #18 {
-   %3 = alloca <16 x i32>, align 64
-   %4 = alloca <16 x i32>, align 64
-   %5 = alloca <16 x i32>, align 64
-@@ -4734,7 +4734,7 @@ define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -4748,7 +4748,7 @@ define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local void @__do_print_cm(i8*, i8*, i32, i64, i32*, i32, i32) #23 !dbg !15 {
-+define internal void @__do_print_cm(i8*, i8*, i32, i64, i32*, i32, i32) #23 !dbg !15 {
-   %8 = alloca i8*, align 4
-   %9 = alloca i8*, align 4
-   %10 = alloca i32, align 4
-@@ -4988,7 +4988,7 @@ define internal void @_ZN7details16_cm_print_formatILi128EEEv15cm_surfaceindexju
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local void @__do_print_lz(i32, i8*, i32, i64, i32*, i32, i32, i32, i32) #26 !dbg !117 {
-+define internal void @__do_print_lz(i32, i8*, i32, i64, i32*, i32, i32, i32, i32) #26 !dbg !117 {
-   %10 = alloca i32, align 4
-   %11 = alloca i8*, align 4
-   %12 = alloca i32, align 4
-@@ -5069,7 +5069,7 @@ define dso_local void @__do_print_lz(i32, i8*, i32, i64, i32*, i32, i32, i32, i3
-   %67 = load i64, i64* %13, align 8, !dbg !159, !tbaa !19
-   %68 = load <5 x i32>, <5 x i32>* %21, align 32, !dbg !160, !tbaa !7
-   call void @_ZN13VaryingWriterC2ERjRPKjiyu2CMvb5_i(%class.VaryingWriter* %23, i32* dereferenceable(4) %19, i32** dereferenceable(4) %14, i32 %66, i64 %67, <5 x i32> %68), !dbg !161
--  %69 = call zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext %62, %class.UniformWriter* byval align 32 %22, %class.VaryingWriter* byval align 32 %23), !dbg !162
-+  %69 = call zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext %62, %class.UniformWriter* byval(%class.UniformWriter) align 32 %22, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %23), !dbg !162
-   br label %70, !dbg !163
- 
- ; <label>:70:                                     ; preds = %60
-@@ -5187,7 +5187,7 @@ define internal <5 x i32> @_Z17get_auxiliary_strv() #28 comdat !dbg !178 {
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval align 32, %class.VaryingWriter* byval align 32) #25 comdat !dbg !191 {
-+define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %class.VaryingWriter* byval(%class.VaryingWriter) align 32) #25 comdat !dbg !191 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.UniformWriter, align 32
-   %6 = alloca %class.VaryingWriter, align 32
-@@ -5196,7 +5196,7 @@ define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13Varyi
-   %8 = bitcast %class.UniformWriter* %5 to i8*, !dbg !196
-   %9 = bitcast %class.UniformWriter* %1 to i8*, !dbg !196
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %8, i8* align 32 %9, i32 64, i1 false), !dbg !196, !tbaa.struct !197
--  %10 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext %7, %class.UniformWriter* byval align 32 %5), !dbg !198
-+  %10 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext %7, %class.UniformWriter* byval(%class.UniformWriter) align 32 %5), !dbg !198
-   br i1 %10, label %16, label %11, !dbg !199
- 
- ; <label>:11:                                     ; preds = %3
-@@ -5204,7 +5204,7 @@ define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13Varyi
-   %13 = bitcast %class.VaryingWriter* %6 to i8*, !dbg !201
-   %14 = bitcast %class.VaryingWriter* %2 to i8*, !dbg !201
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %13, i8* align 32 %14, i32 64, i1 false), !dbg !201, !tbaa.struct !197
--  %15 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext %12, %class.VaryingWriter* byval align 32 %6), !dbg !202
-+  %15 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext %12, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %6), !dbg !202
-   br label %16, !dbg !199
- 
- ; <label>:16:                                     ; preds = %11, %3
-@@ -5279,7 +5279,7 @@ define internal void @_ZN13VaryingWriterC2ERjRPKjiyu2CMvb5_i(%class.VaryingWrite
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @__num_cores() #29 !dbg !236 {
-+define internal i32 @__num_cores() #29 !dbg !236 {
-   ret i32 -1, !dbg !237
- }
- 
-@@ -8860,7 +8860,7 @@ declare dso_local void @_ZN7details37__cm_intrinsic_impl_svm_scatter_writeIiLi1E
- declare void @llvm.genx.svm.scatter.v1i1.v1i64.v1i32(<1 x i1>, i32, <1 x i64>, <1 x i32>) #27
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext, %class.UniformWriter* byval align 32) #25 comdat !dbg !1645 {
-+define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32) #25 comdat !dbg !1645 {
-   %3 = alloca i8, align 1
-   %4 = alloca %class.UniformWriter, align 32
-   %5 = alloca %"struct.PrintInfo::Encoding4Uniform", align 1
-@@ -8869,7 +8869,7 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWrite
-   %7 = bitcast %class.UniformWriter* %4 to i8*, !dbg !1647
-   %8 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1647
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %7, i8* align 32 %8, i32 64, i1 false), !dbg !1647, !tbaa.struct !197
--  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext %6, %class.UniformWriter* byval align 32 %4, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %5), !dbg !1648
-+  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext %6, %class.UniformWriter* byval(%class.UniformWriter) align 32 %4, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %5), !dbg !1648
-   ret i1 %9, !dbg !1649
- }
- 
-@@ -8877,7 +8877,7 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWrite
- declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1) #32
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext, %class.VaryingWriter* byval align 32) #25 comdat !dbg !1650 {
-+define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32) #25 comdat !dbg !1650 {
-   %3 = alloca i8, align 1
-   %4 = alloca %class.VaryingWriter, align 32
-   %5 = alloca %"struct.PrintInfo::Encoding4Varying", align 1
-@@ -8886,12 +8886,12 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWrite
-   %7 = bitcast %class.VaryingWriter* %4 to i8*, !dbg !1652
-   %8 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !1652
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %7, i8* align 32 %8, i32 64, i1 false), !dbg !1652, !tbaa.struct !197
--  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext %6, %class.VaryingWriter* byval align 32 %4, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %5), !dbg !1653
-+  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext %6, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %4, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %5), !dbg !1653
-   ret i1 %9, !dbg !1654
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1655 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1655 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.UniformWriter, align 32
-   %6 = alloca %"struct.PrintInfo::Encoding4Uniform", align 1
-@@ -8914,7 +8914,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %22 = bitcast %class.UniformWriter* %5 to i8*, !dbg !1657
-   %23 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1657
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %22, i8* align 32 %23, i32 64, i1 false), !dbg !1657, !tbaa.struct !197
--  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.UniformWriter* byval align 32 %5, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %6), !dbg !1658
-+  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.UniformWriter* byval(%class.UniformWriter) align 32 %5, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %6), !dbg !1658
-   br i1 %24, label %60, label %25, !dbg !1659
- 
- ; <label>:25:                                     ; preds = %3
-@@ -8922,7 +8922,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %27 = bitcast %class.UniformWriter* %7 to i8*, !dbg !1661
-   %28 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1661
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %27, i8* align 32 %28, i32 64, i1 false), !dbg !1661, !tbaa.struct !197
--  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.UniformWriter* byval align 32 %7, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %8), !dbg !1662
-+  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.UniformWriter* byval(%class.UniformWriter) align 32 %7, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %8), !dbg !1662
-   br i1 %29, label %60, label %30, !dbg !1663
- 
- ; <label>:30:                                     ; preds = %25
-@@ -8930,7 +8930,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %32 = bitcast %class.UniformWriter* %9 to i8*, !dbg !1665
-   %33 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1665
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %32, i8* align 32 %33, i32 64, i1 false), !dbg !1665, !tbaa.struct !197
--  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.UniformWriter* byval align 32 %9, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %10), !dbg !1666
-+  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.UniformWriter* byval(%class.UniformWriter) align 32 %9, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %10), !dbg !1666
-   br i1 %34, label %60, label %35, !dbg !1667
- 
- ; <label>:35:                                     ; preds = %30
-@@ -8938,7 +8938,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %37 = bitcast %class.UniformWriter* %11 to i8*, !dbg !1669
-   %38 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1669
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %37, i8* align 32 %38, i32 64, i1 false), !dbg !1669, !tbaa.struct !197
--  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.UniformWriter* byval align 32 %11, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %12), !dbg !1670
-+  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.UniformWriter* byval(%class.UniformWriter) align 32 %11, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %12), !dbg !1670
-   br i1 %39, label %60, label %40, !dbg !1671
- 
- ; <label>:40:                                     ; preds = %35
-@@ -8946,7 +8946,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %42 = bitcast %class.UniformWriter* %13 to i8*, !dbg !1673
-   %43 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1673
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %42, i8* align 32 %43, i32 64, i1 false), !dbg !1673, !tbaa.struct !197
--  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.UniformWriter* byval align 32 %13, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %14), !dbg !1674
-+  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.UniformWriter* byval(%class.UniformWriter) align 32 %13, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %14), !dbg !1674
-   br i1 %44, label %60, label %45, !dbg !1675
- 
- ; <label>:45:                                     ; preds = %40
-@@ -8954,7 +8954,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %47 = bitcast %class.UniformWriter* %15 to i8*, !dbg !1677
-   %48 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1677
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %47, i8* align 32 %48, i32 64, i1 false), !dbg !1677, !tbaa.struct !197
--  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.UniformWriter* byval align 32 %15, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %16), !dbg !1678
-+  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.UniformWriter* byval(%class.UniformWriter) align 32 %15, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %16), !dbg !1678
-   br i1 %49, label %60, label %50, !dbg !1679
- 
- ; <label>:50:                                     ; preds = %45
-@@ -8962,7 +8962,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %52 = bitcast %class.UniformWriter* %17 to i8*, !dbg !1681
-   %53 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1681
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %52, i8* align 32 %53, i32 64, i1 false), !dbg !1681, !tbaa.struct !197
--  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.UniformWriter* byval align 32 %17, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %18), !dbg !1682
-+  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.UniformWriter* byval(%class.UniformWriter) align 32 %17, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %18), !dbg !1682
-   br i1 %54, label %60, label %55, !dbg !1683
- 
- ; <label>:55:                                     ; preds = %50
-@@ -8970,7 +8970,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %57 = bitcast %class.UniformWriter* %19 to i8*, !dbg !1685
-   %58 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1685
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %57, i8* align 32 %58, i32 64, i1 false), !dbg !1685, !tbaa.struct !197
--  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.UniformWriter* byval align 32 %19, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %20), !dbg !1686
-+  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.UniformWriter* byval(%class.UniformWriter) align 32 %19, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %20), !dbg !1686
-   br label %60, !dbg !1683
- 
- ; <label>:60:                                     ; preds = %55, %50, %45, %40, %35, %30, %25, %3
-@@ -8979,7 +8979,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1688 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1688 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9005,7 +9005,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1697 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1697 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9031,7 +9031,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1706 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1706 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9057,7 +9057,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1715 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1715 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9083,7 +9083,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1724 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1724 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9109,7 +9109,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1733 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1733 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9135,7 +9135,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1742 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1742 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9161,7 +9161,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1751 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1751 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9984,7 +9984,7 @@ define internal i32 @_ZN7details18_cm_print_type_oclIPvEENS_18SHADER_PRINTF_TYPE
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2055 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2055 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.VaryingWriter, align 32
-   %6 = alloca %"struct.PrintInfo::Encoding4Varying", align 1
-@@ -10007,7 +10007,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %22 = bitcast %class.VaryingWriter* %5 to i8*, !dbg !2057
-   %23 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2057
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %22, i8* align 32 %23, i32 64, i1 false), !dbg !2057, !tbaa.struct !197
--  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.VaryingWriter* byval align 32 %5, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %6), !dbg !2058
-+  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %5, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %6), !dbg !2058
-   br i1 %24, label %60, label %25, !dbg !2059
- 
- ; <label>:25:                                     ; preds = %3
-@@ -10015,7 +10015,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %27 = bitcast %class.VaryingWriter* %7 to i8*, !dbg !2061
-   %28 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2061
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %27, i8* align 32 %28, i32 64, i1 false), !dbg !2061, !tbaa.struct !197
--  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.VaryingWriter* byval align 32 %7, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %8), !dbg !2062
-+  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %7, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %8), !dbg !2062
-   br i1 %29, label %60, label %30, !dbg !2063
- 
- ; <label>:30:                                     ; preds = %25
-@@ -10023,7 +10023,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %32 = bitcast %class.VaryingWriter* %9 to i8*, !dbg !2065
-   %33 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2065
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %32, i8* align 32 %33, i32 64, i1 false), !dbg !2065, !tbaa.struct !197
--  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.VaryingWriter* byval align 32 %9, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %10), !dbg !2066
-+  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %9, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %10), !dbg !2066
-   br i1 %34, label %60, label %35, !dbg !2067
- 
- ; <label>:35:                                     ; preds = %30
-@@ -10031,7 +10031,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %37 = bitcast %class.VaryingWriter* %11 to i8*, !dbg !2069
-   %38 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2069
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %37, i8* align 32 %38, i32 64, i1 false), !dbg !2069, !tbaa.struct !197
--  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.VaryingWriter* byval align 32 %11, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %12), !dbg !2070
-+  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %11, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %12), !dbg !2070
-   br i1 %39, label %60, label %40, !dbg !2071
- 
- ; <label>:40:                                     ; preds = %35
-@@ -10039,7 +10039,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %42 = bitcast %class.VaryingWriter* %13 to i8*, !dbg !2073
-   %43 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2073
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %42, i8* align 32 %43, i32 64, i1 false), !dbg !2073, !tbaa.struct !197
--  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.VaryingWriter* byval align 32 %13, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %14), !dbg !2074
-+  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %13, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %14), !dbg !2074
-   br i1 %44, label %60, label %45, !dbg !2075
- 
- ; <label>:45:                                     ; preds = %40
-@@ -10047,7 +10047,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %47 = bitcast %class.VaryingWriter* %15 to i8*, !dbg !2077
-   %48 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2077
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %47, i8* align 32 %48, i32 64, i1 false), !dbg !2077, !tbaa.struct !197
--  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.VaryingWriter* byval align 32 %15, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %16), !dbg !2078
-+  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %15, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %16), !dbg !2078
-   br i1 %49, label %60, label %50, !dbg !2079
- 
- ; <label>:50:                                     ; preds = %45
-@@ -10055,7 +10055,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %52 = bitcast %class.VaryingWriter* %17 to i8*, !dbg !2081
-   %53 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2081
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %52, i8* align 32 %53, i32 64, i1 false), !dbg !2081, !tbaa.struct !197
--  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.VaryingWriter* byval align 32 %17, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %18), !dbg !2082
-+  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %17, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %18), !dbg !2082
-   br i1 %54, label %60, label %55, !dbg !2083
- 
- ; <label>:55:                                     ; preds = %50
-@@ -10063,7 +10063,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %57 = bitcast %class.VaryingWriter* %19 to i8*, !dbg !2085
-   %58 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2085
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %57, i8* align 32 %58, i32 64, i1 false), !dbg !2085, !tbaa.struct !197
--  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.VaryingWriter* byval align 32 %19, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %20), !dbg !2086
-+  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %19, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %20), !dbg !2086
-   br label %60, !dbg !2083
- 
- ; <label>:60:                                     ; preds = %55, %50, %45, %40, %35, %30, %25, %3
-@@ -10072,7 +10072,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2088 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2088 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10098,7 +10098,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2097 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2097 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10124,7 +10124,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2106 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2106 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10150,7 +10150,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2115 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2115 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10176,7 +10176,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2124 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2124 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10202,7 +10202,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2133 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2133 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10228,7 +10228,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2142 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2142 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10254,7 +10254,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2151 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2151 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-diff --git a/builtins/builtins-cm-64.ll b/builtins/builtins-cm-64.ll
-index 39a2dd8be..375d01bed 100644
---- a/builtins/builtins-cm-64.ll
-+++ b/builtins/builtins-cm-64.ll
-@@ -557,7 +557,7 @@ $_ZN13VaryingWriter12WriteVecElemIPvEEvv = comdat any
- @.str.10 = private unnamed_addr constant [8 x i8] c"%016llX\00", align 1
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i8 @_Z24__cm_intrinsic_impl_sdivcc(i8 signext, i8 signext) #0 {
-+define internal signext i8 @_Z24__cm_intrinsic_impl_sdivcc(i8 signext, i8 signext) #0 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -618,7 +618,7 @@ define internal <1 x i8> @_ZN7details13__impl_divremILi1EEEu2CMvbT__cS1_S1_u2CMv
- declare <1 x i8> @llvm.genx.rdregioni.v1i8.v1i8.i16(<1 x i8>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -634,7 +634,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -680,7 +680,7 @@ define internal <2 x i8> @_ZN7details13__impl_divremILi2EEEu2CMvbT__cS1_S1_u2CMv
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -818,7 +818,7 @@ define internal <16 x i8> @_ZN7details13__impl_divremILi16EEEu2CMvbT__cS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -864,7 +864,7 @@ define internal <32 x i8> @_ZN7details13__impl_divremILi32EEEu2CMvbT__cS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signext) #0 {
-+define internal signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signext) #0 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -890,7 +890,7 @@ define dso_local signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signe
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -904,7 +904,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -918,7 +918,7 @@ define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -932,7 +932,7 @@ define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8 x i8>) #7 {
-+define internal <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8 x i8>) #7 {
-   %3 = alloca <8 x i8>, align 8
-   %4 = alloca <8 x i8>, align 8
-   %5 = alloca <8 x i8>, align 8
-@@ -946,7 +946,7 @@ define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>, <16 x i8>) #9 {
-+define internal <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>, <16 x i8>) #9 {
-   %3 = alloca <16 x i8>, align 16
-   %4 = alloca <16 x i8>, align 16
-   %5 = alloca <16 x i8>, align 16
-@@ -960,7 +960,7 @@ define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -974,7 +974,7 @@ define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i16 @_Z24__cm_intrinsic_impl_sdivss(i16 signext, i16 signext) #3 {
-+define internal signext i16 @_Z24__cm_intrinsic_impl_sdivss(i16 signext, i16 signext) #3 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1058,7 +1058,7 @@ define internal <1 x i16> @_ZN7details13__impl_divremILi1EEEu2CMvbT__sS1_S1_u2CM
- declare <1 x i16> @llvm.genx.rdregioni.v1i16.v1i16.i16(<1 x i16>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1074,7 +1074,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -1143,7 +1143,7 @@ define internal <2 x i16> @_ZN7details13__impl_divremILi2EEEu2CMvbT__sS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -1350,7 +1350,7 @@ define internal <16 x i16> @_ZN7details13__impl_divremILi16EEEu2CMvbT__sS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -1419,7 +1419,7 @@ define internal <32 x i16> @_ZN7details13__impl_divremILi32EEEu2CMvbT__sS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 signext) #3 {
-+define internal signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 signext) #3 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1445,7 +1445,7 @@ define dso_local signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 si
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1459,7 +1459,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -1473,7 +1473,7 @@ define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -1487,7 +1487,7 @@ define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <8 x i16>) #9 {
-+define internal <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <8 x i16>) #9 {
-   %3 = alloca <8 x i16>, align 16
-   %4 = alloca <8 x i16>, align 16
-   %5 = alloca <8 x i16>, align 16
-@@ -1501,7 +1501,7 @@ define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>, <16 x i16>) #11 {
-+define internal <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>, <16 x i16>) #11 {
-   %3 = alloca <16 x i16>, align 32
-   %4 = alloca <16 x i16>, align 32
-   %5 = alloca <16 x i16>, align 32
-@@ -1515,7 +1515,7 @@ define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -1529,7 +1529,7 @@ define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_sdivii(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_sdivii(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -1730,7 +1730,7 @@ define internal <1 x i32> @_ZN7details13__impl_divremILi1EEEu2CMvbT__iS1_S1_u2CM
- declare <1 x i32> @llvm.genx.rdregioni.v1i32.v1i32.i16(<1 x i32>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -1746,7 +1746,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -1932,7 +1932,7 @@ define internal <2 x i32> @_ZN7details13__impl_divremILi2EEEu2CMvbT__iS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -2490,7 +2490,7 @@ define internal <16 x i32> @_ZN7details13__impl_divremILi16EEEu2CMvbT__iS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -2676,7 +2676,7 @@ define internal <32 x i32> @_ZN7details13__impl_divremILi32EEEu2CMvbT__iS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -2702,7 +2702,7 @@ define dso_local i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -2716,7 +2716,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -2730,7 +2730,7 @@ define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -2744,7 +2744,7 @@ define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <8 x i32>) #17 {
-+define internal <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <8 x i32>) #17 {
-   %3 = alloca <8 x i32>, align 32
-   %4 = alloca <8 x i32>, align 32
-   %5 = alloca <8 x i32>, align 32
-@@ -2758,7 +2758,7 @@ define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>, <16 x i32>) #18 {
-+define internal <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>, <16 x i32>) #18 {
-   %3 = alloca <16 x i32>, align 64
-   %4 = alloca <16 x i32>, align 64
-   %5 = alloca <16 x i32>, align 64
-@@ -2772,7 +2772,7 @@ define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -2786,7 +2786,7 @@ define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_udivhh(i8 zeroext, i8 zeroext) #21 {
-+define internal zeroext i8 @_Z24__cm_intrinsic_impl_udivhh(i8 zeroext, i8 zeroext) #21 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -2844,7 +2844,7 @@ define internal <1 x i8> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__hS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -2860,7 +2860,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -2906,7 +2906,7 @@ define internal <2 x i8> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__hS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -3044,7 +3044,7 @@ define internal <16 x i8> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__hS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -3090,7 +3090,7 @@ define internal <32 x i8> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__hS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroext) #21 {
-+define internal zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroext) #21 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -3116,7 +3116,7 @@ define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroe
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -3130,7 +3130,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -3144,7 +3144,7 @@ define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -3158,7 +3158,7 @@ define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8 x i8>) #15 {
-+define internal <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8 x i8>) #15 {
-   %3 = alloca <8 x i8>, align 8
-   %4 = alloca <8 x i8>, align 8
-   %5 = alloca <8 x i8>, align 8
-@@ -3172,7 +3172,7 @@ define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>, <16 x i8>) #16 {
-+define internal <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>, <16 x i8>) #16 {
-   %3 = alloca <16 x i8>, align 16
-   %4 = alloca <16 x i8>, align 16
-   %5 = alloca <16 x i8>, align 16
-@@ -3186,7 +3186,7 @@ define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -3200,7 +3200,7 @@ define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_udivtt(i16 zeroext, i16 zeroext) #22 {
-+define internal zeroext i16 @_Z24__cm_intrinsic_impl_udivtt(i16 zeroext, i16 zeroext) #22 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3278,7 +3278,7 @@ define internal <1 x i16> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__tS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3294,7 +3294,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -3360,7 +3360,7 @@ define internal <2 x i16> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__tS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -3558,7 +3558,7 @@ define internal <16 x i16> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__tS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -3624,7 +3624,7 @@ define internal <32 x i16> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__tS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 zeroext) #22 {
-+define internal zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 zeroext) #22 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3650,7 +3650,7 @@ define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 ze
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3664,7 +3664,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -3678,7 +3678,7 @@ define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -3692,7 +3692,7 @@ define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <8 x i16>) #16 {
-+define internal <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <8 x i16>) #16 {
-   %3 = alloca <8 x i16>, align 16
-   %4 = alloca <8 x i16>, align 16
-   %5 = alloca <8 x i16>, align 16
-@@ -3706,7 +3706,7 @@ define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>, <16 x i16>) #17 {
-+define internal <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>, <16 x i16>) #17 {
-   %3 = alloca <16 x i16>, align 32
-   %4 = alloca <16 x i16>, align 32
-   %5 = alloca <16 x i16>, align 32
-@@ -3720,7 +3720,7 @@ define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -3734,7 +3734,7 @@ define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_udivjj(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_udivjj(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -3892,7 +3892,7 @@ define internal <1 x i32> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__jS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -3908,7 +3908,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -4054,7 +4054,7 @@ define internal <2 x i32> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__jS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -4492,7 +4492,7 @@ define internal <16 x i32> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__jS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -4638,7 +4638,7 @@ define internal <32 x i32> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__jS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -4664,7 +4664,7 @@ define dso_local i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -4678,7 +4678,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -4692,7 +4692,7 @@ define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -4706,7 +4706,7 @@ define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <8 x i32>) #17 {
-+define internal <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <8 x i32>) #17 {
-   %3 = alloca <8 x i32>, align 32
-   %4 = alloca <8 x i32>, align 32
-   %5 = alloca <8 x i32>, align 32
-@@ -4720,7 +4720,7 @@ define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>, <16 x i32>) #18 {
-+define internal <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>, <16 x i32>) #18 {
-   %3 = alloca <16 x i32>, align 64
-   %4 = alloca <16 x i32>, align 64
-   %5 = alloca <16 x i32>, align 64
-@@ -4734,7 +4734,7 @@ define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -4748,7 +4748,7 @@ define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local void @__do_print_cm(i8*, i8*, i32, i64, i32*, i32, i32) #23 !dbg !15 {
-+define internal void @__do_print_cm(i8*, i8*, i32, i64, i32*, i32, i32) #23 !dbg !15 {
-   %8 = alloca i8*, align 8
-   %9 = alloca i8*, align 8
-   %10 = alloca i32, align 4
-@@ -5070,7 +5070,7 @@ define dso_local void @__do_print_lz(i32, i8*, i32, i64, i32*, i32, i32, i32, i3
-   %67 = load i64, i64* %13, align 8, !dbg !159, !tbaa !19
-   %68 = load <5 x i32>, <5 x i32>* %21, align 32, !dbg !160, !tbaa !7
-   call void @_ZN13VaryingWriterC2ERyRPKjiyu2CMvb5_i(%class.VaryingWriter* %23, i64* dereferenceable(8) %19, i32** dereferenceable(8) %14, i32 %66, i64 %67, <5 x i32> %68), !dbg !161
--  %69 = call zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext %62, %class.UniformWriter* byval align 32 %22, %class.VaryingWriter* byval align 32 %23), !dbg !162
-+  %69 = call zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext %62, %class.UniformWriter* byval(%class.UniformWriter) align 32 %22, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %23), !dbg !162
-   br label %70, !dbg !163
- 
- ; <label>:70:                                     ; preds = %60
-@@ -5188,7 +5188,7 @@ define internal <5 x i32> @_Z17get_auxiliary_strv() #28 comdat !dbg !178 {
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval align 32, %class.VaryingWriter* byval align 32) #25 comdat !dbg !191 {
-+define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %class.VaryingWriter* byval(%class.VaryingWriter) align 32) #25 comdat !dbg !191 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.UniformWriter, align 32
-   %6 = alloca %class.VaryingWriter, align 32
-@@ -5197,7 +5197,7 @@ define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13Varyi
-   %8 = bitcast %class.UniformWriter* %5 to i8*, !dbg !196
-   %9 = bitcast %class.UniformWriter* %1 to i8*, !dbg !196
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %8, i8* align 32 %9, i64 64, i1 false), !dbg !196, !tbaa.struct !197
--  %10 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext %7, %class.UniformWriter* byval align 32 %5), !dbg !198
-+  %10 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext %7, %class.UniformWriter* byval(%class.UniformWriter) align 32 %5), !dbg !198
-   br i1 %10, label %16, label %11, !dbg !199
- 
- ; <label>:11:                                     ; preds = %3
-@@ -5205,7 +5205,7 @@ define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13Varyi
-   %13 = bitcast %class.VaryingWriter* %6 to i8*, !dbg !201
-   %14 = bitcast %class.VaryingWriter* %2 to i8*, !dbg !201
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %13, i8* align 32 %14, i64 64, i1 false), !dbg !201, !tbaa.struct !197
--  %15 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext %12, %class.VaryingWriter* byval align 32 %6), !dbg !202
-+  %15 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext %12, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %6), !dbg !202
-   br label %16, !dbg !199
- 
- ; <label>:16:                                     ; preds = %11, %3
-@@ -5280,7 +5280,7 @@ define internal void @_ZN13VaryingWriterC2ERyRPKjiyu2CMvb5_i(%class.VaryingWrite
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @__num_cores() #29 !dbg !236 {
-+define internal i32 @__num_cores() #29 !dbg !236 {
-   ret i32 -1, !dbg !237
- }
- 
-@@ -8870,7 +8870,7 @@ declare dso_local void @_ZN7details37__cm_intrinsic_impl_svm_scatter_writeIiLi1E
- declare void @llvm.genx.svm.scatter.v1i1.v1i64.v1i32(<1 x i1>, i32, <1 x i64>, <1 x i32>) #27
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext, %class.UniformWriter* byval align 32) #25 comdat !dbg !1645 {
-+define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32) #25 comdat !dbg !1645 {
-   %3 = alloca i8, align 1
-   %4 = alloca %class.UniformWriter, align 32
-   %5 = alloca %"struct.PrintInfo::Encoding4Uniform", align 1
-@@ -8879,7 +8879,7 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWrite
-   %7 = bitcast %class.UniformWriter* %4 to i8*, !dbg !1647
-   %8 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1647
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %7, i8* align 32 %8, i64 64, i1 false), !dbg !1647, !tbaa.struct !197
--  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext %6, %class.UniformWriter* byval align 32 %4, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %5), !dbg !1648
-+  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext %6, %class.UniformWriter* byval(%class.UniformWriter) align 32 %4, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %5), !dbg !1648
-   ret i1 %9, !dbg !1649
- }
- 
-@@ -8887,7 +8887,7 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWrite
- declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #32
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext, %class.VaryingWriter* byval align 32) #25 comdat !dbg !1650 {
-+define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32) #25 comdat !dbg !1650 {
-   %3 = alloca i8, align 1
-   %4 = alloca %class.VaryingWriter, align 32
-   %5 = alloca %"struct.PrintInfo::Encoding4Varying", align 1
-@@ -8896,12 +8896,12 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWrite
-   %7 = bitcast %class.VaryingWriter* %4 to i8*, !dbg !1652
-   %8 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !1652
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %7, i8* align 32 %8, i64 64, i1 false), !dbg !1652, !tbaa.struct !197
--  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext %6, %class.VaryingWriter* byval align 32 %4, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %5), !dbg !1653
-+  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext %6, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %4, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %5), !dbg !1653
-   ret i1 %9, !dbg !1654
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1655 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1655 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.UniformWriter, align 32
-   %6 = alloca %"struct.PrintInfo::Encoding4Uniform", align 1
-@@ -8924,7 +8924,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %22 = bitcast %class.UniformWriter* %5 to i8*, !dbg !1657
-   %23 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1657
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %22, i8* align 32 %23, i64 64, i1 false), !dbg !1657, !tbaa.struct !197
--  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.UniformWriter* byval align 32 %5, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %6), !dbg !1658
-+  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.UniformWriter* byval(%class.UniformWriter) align 32 %5, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %6), !dbg !1658
-   br i1 %24, label %60, label %25, !dbg !1659
- 
- ; <label>:25:                                     ; preds = %3
-@@ -8932,7 +8932,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %27 = bitcast %class.UniformWriter* %7 to i8*, !dbg !1661
-   %28 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1661
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %27, i8* align 32 %28, i64 64, i1 false), !dbg !1661, !tbaa.struct !197
--  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.UniformWriter* byval align 32 %7, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %8), !dbg !1662
-+  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.UniformWriter* byval(%class.UniformWriter) align 32 %7, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %8), !dbg !1662
-   br i1 %29, label %60, label %30, !dbg !1663
- 
- ; <label>:30:                                     ; preds = %25
-@@ -8940,7 +8940,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %32 = bitcast %class.UniformWriter* %9 to i8*, !dbg !1665
-   %33 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1665
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %32, i8* align 32 %33, i64 64, i1 false), !dbg !1665, !tbaa.struct !197
--  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.UniformWriter* byval align 32 %9, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %10), !dbg !1666
-+  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.UniformWriter* byval(%class.UniformWriter) align 32 %9, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %10), !dbg !1666
-   br i1 %34, label %60, label %35, !dbg !1667
- 
- ; <label>:35:                                     ; preds = %30
-@@ -8948,7 +8948,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %37 = bitcast %class.UniformWriter* %11 to i8*, !dbg !1669
-   %38 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1669
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %37, i8* align 32 %38, i64 64, i1 false), !dbg !1669, !tbaa.struct !197
--  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.UniformWriter* byval align 32 %11, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %12), !dbg !1670
-+  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.UniformWriter* byval(%class.UniformWriter) align 32 %11, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %12), !dbg !1670
-   br i1 %39, label %60, label %40, !dbg !1671
- 
- ; <label>:40:                                     ; preds = %35
-@@ -8956,7 +8956,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %42 = bitcast %class.UniformWriter* %13 to i8*, !dbg !1673
-   %43 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1673
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %42, i8* align 32 %43, i64 64, i1 false), !dbg !1673, !tbaa.struct !197
--  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.UniformWriter* byval align 32 %13, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %14), !dbg !1674
-+  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.UniformWriter* byval(%class.UniformWriter) align 32 %13, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %14), !dbg !1674
-   br i1 %44, label %60, label %45, !dbg !1675
- 
- ; <label>:45:                                     ; preds = %40
-@@ -8964,7 +8964,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %47 = bitcast %class.UniformWriter* %15 to i8*, !dbg !1677
-   %48 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1677
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %47, i8* align 32 %48, i64 64, i1 false), !dbg !1677, !tbaa.struct !197
--  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.UniformWriter* byval align 32 %15, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %16), !dbg !1678
-+  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.UniformWriter* byval(%class.UniformWriter) align 32 %15, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %16), !dbg !1678
-   br i1 %49, label %60, label %50, !dbg !1679
- 
- ; <label>:50:                                     ; preds = %45
-@@ -8972,7 +8972,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %52 = bitcast %class.UniformWriter* %17 to i8*, !dbg !1681
-   %53 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1681
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %52, i8* align 32 %53, i64 64, i1 false), !dbg !1681, !tbaa.struct !197
--  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.UniformWriter* byval align 32 %17, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %18), !dbg !1682
-+  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.UniformWriter* byval(%class.UniformWriter) align 32 %17, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %18), !dbg !1682
-   br i1 %54, label %60, label %55, !dbg !1683
- 
- ; <label>:55:                                     ; preds = %50
-@@ -8980,7 +8980,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %57 = bitcast %class.UniformWriter* %19 to i8*, !dbg !1685
-   %58 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1685
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %57, i8* align 32 %58, i64 64, i1 false), !dbg !1685, !tbaa.struct !197
--  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.UniformWriter* byval align 32 %19, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %20), !dbg !1686
-+  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.UniformWriter* byval(%class.UniformWriter) align 32 %19, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %20), !dbg !1686
-   br label %60, !dbg !1683
- 
- ; <label>:60:                                     ; preds = %55, %50, %45, %40, %35, %30, %25, %3
-@@ -8989,7 +8989,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1688 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1688 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9015,7 +9015,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1697 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1697 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9041,7 +9041,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1706 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1706 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9067,7 +9067,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1715 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1715 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9093,7 +9093,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1724 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1724 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9119,7 +9119,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1733 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1733 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9145,7 +9145,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1742 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1742 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9171,7 +9171,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1751 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1751 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10013,7 +10013,7 @@ define internal i32 @_ZN7details18_cm_print_type_oclIPvEENS_18SHADER_PRINTF_TYPE
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2061 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2061 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.VaryingWriter, align 32
-   %6 = alloca %"struct.PrintInfo::Encoding4Varying", align 1
-@@ -10036,7 +10036,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %22 = bitcast %class.VaryingWriter* %5 to i8*, !dbg !2063
-   %23 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2063
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %22, i8* align 32 %23, i64 64, i1 false), !dbg !2063, !tbaa.struct !197
--  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.VaryingWriter* byval align 32 %5, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %6), !dbg !2064
-+  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %5, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %6), !dbg !2064
-   br i1 %24, label %60, label %25, !dbg !2065
- 
- ; <label>:25:                                     ; preds = %3
-@@ -10044,7 +10044,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %27 = bitcast %class.VaryingWriter* %7 to i8*, !dbg !2067
-   %28 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2067
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %27, i8* align 32 %28, i64 64, i1 false), !dbg !2067, !tbaa.struct !197
--  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.VaryingWriter* byval align 32 %7, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %8), !dbg !2068
-+  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %7, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %8), !dbg !2068
-   br i1 %29, label %60, label %30, !dbg !2069
- 
- ; <label>:30:                                     ; preds = %25
-@@ -10052,7 +10052,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %32 = bitcast %class.VaryingWriter* %9 to i8*, !dbg !2071
-   %33 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2071
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %32, i8* align 32 %33, i64 64, i1 false), !dbg !2071, !tbaa.struct !197
--  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.VaryingWriter* byval align 32 %9, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %10), !dbg !2072
-+  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %9, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %10), !dbg !2072
-   br i1 %34, label %60, label %35, !dbg !2073
- 
- ; <label>:35:                                     ; preds = %30
-@@ -10060,7 +10060,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %37 = bitcast %class.VaryingWriter* %11 to i8*, !dbg !2075
-   %38 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2075
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %37, i8* align 32 %38, i64 64, i1 false), !dbg !2075, !tbaa.struct !197
--  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.VaryingWriter* byval align 32 %11, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %12), !dbg !2076
-+  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %11, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %12), !dbg !2076
-   br i1 %39, label %60, label %40, !dbg !2077
- 
- ; <label>:40:                                     ; preds = %35
-@@ -10068,7 +10068,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %42 = bitcast %class.VaryingWriter* %13 to i8*, !dbg !2079
-   %43 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2079
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %42, i8* align 32 %43, i64 64, i1 false), !dbg !2079, !tbaa.struct !197
--  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.VaryingWriter* byval align 32 %13, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %14), !dbg !2080
-+  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %13, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %14), !dbg !2080
-   br i1 %44, label %60, label %45, !dbg !2081
- 
- ; <label>:45:                                     ; preds = %40
-@@ -10076,7 +10076,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %47 = bitcast %class.VaryingWriter* %15 to i8*, !dbg !2083
-   %48 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2083
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %47, i8* align 32 %48, i64 64, i1 false), !dbg !2083, !tbaa.struct !197
--  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.VaryingWriter* byval align 32 %15, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %16), !dbg !2084
-+  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %15, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %16), !dbg !2084
-   br i1 %49, label %60, label %50, !dbg !2085
- 
- ; <label>:50:                                     ; preds = %45
-@@ -10084,7 +10084,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %52 = bitcast %class.VaryingWriter* %17 to i8*, !dbg !2087
-   %53 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2087
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %52, i8* align 32 %53, i64 64, i1 false), !dbg !2087, !tbaa.struct !197
--  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.VaryingWriter* byval align 32 %17, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %18), !dbg !2088
-+  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %17, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %18), !dbg !2088
-   br i1 %54, label %60, label %55, !dbg !2089
- 
- ; <label>:55:                                     ; preds = %50
-@@ -10092,7 +10092,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %57 = bitcast %class.VaryingWriter* %19 to i8*, !dbg !2091
-   %58 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2091
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %57, i8* align 32 %58, i64 64, i1 false), !dbg !2091, !tbaa.struct !197
--  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.VaryingWriter* byval align 32 %19, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %20), !dbg !2092
-+  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %19, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %20), !dbg !2092
-   br label %60, !dbg !2089
- 
- ; <label>:60:                                     ; preds = %55, %50, %45, %40, %35, %30, %25, %3
-@@ -10101,7 +10101,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2094 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2094 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10127,7 +10127,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2103 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2103 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10153,7 +10153,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2112 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2112 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10179,7 +10179,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2121 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2121 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10205,7 +10205,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2130 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2130 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10231,7 +10231,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2139 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2139 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10257,7 +10257,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2148 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2148 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10283,7 +10283,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2157 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2157 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 9c3acb42a9cf..d61dcc1b961a 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,19 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.15.0
-revision=2
+version=1.18.1.r290+e88e49e
+revision=1
+_ispc_commit=e88e49eb161aa5e75aecc843d479d5e757f5c43e
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
 makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
-distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=2658ff00dc045ac9fcefbf6bd26dffaf723b059a942a27df91bbb61bc503a285
+distfiles="https://github.com/ispc/ispc/archive/${_ispc_commit}.tar.gz"
+checksum=e0181f0f4dc78809166a8c28a46a3cb1f24d3dbbead4f4ff7e4ebfd8d109ebbd
 nocross=yes
 nopie=yes
 
@@ -22,7 +23,7 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 
 pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
+	vsed -i '/tinfo/d' CMakeLists.txt
 }
 
 post_install() {

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

* Re: [PR PATCH] [Updated] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (75 preceding siblings ...)
  2023-02-22 19:26 ` tranzystorek-io
@ 2023-02-22 19:41 ` tranzystorek-io
  2023-02-24 22:55 ` Johnnynator
                   ` (17 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-02-22 19:41 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From c47545dddcf0bcaa87ac2fcf375967eb5b0b7a23 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   3 +
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 2028226606bc..435de5edf596 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,7 +990,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 4d2acec1719dbb6908388663302276174044db42 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 435de5edf596..07004ce71c0b 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -985,9 +985,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 667e663c1aea850adeae602cfd3b23052cd11b19 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From c34515333ba1ee1d28d6a7e404d70ec8d667c849 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 07004ce71c0b..66818d478a6f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -991,7 +991,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 64d6f61cc9ace1861933971d1ba78c7e27ea6fcf Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 9a4916736c3809dc625ae5aa556c78b882663364 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 2b246fe594b96cdbd84c2aa309695f2b930b01c7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From cf7e36a8ddaa003f28a997de9c1d24c24d7fb7a4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 2af2fbca15eedb128c1e84f9382766243a98d66f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From c5e934a3ae923b6c14e667ba593ef9de5402a7e4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From c5d37e2e04defa41bffff735bf6a0e7693159c36 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From dc1051562fe82f8e795c137768474d917437675f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 45f9449335365e902fffac779e6c881ee02bd86a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From a3e05d103476891837f764ce0c985fd7a9ad876a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 4823df92738066235c5a61a74df13739fb8d792f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 5eb275583138..c32ee5240a44 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 93393fb885653b211d5488152bba9bdbe3f7ed71 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 9755879c0a833e48d2731b9b32ca080dc58a93f2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From b4f3e955411d754e45354a4ea9e9645049fde76e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 20f750a4a4228d8613198a5b1a01a8524ea1859b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From c50d26221acfda220bfc2f0271dccbb915bf0569 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 2d27dc883a9adfa19ffd7371b681650b8ff9cebd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index 66818d478a6f..749306c97cc8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2188,10 +2188,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From dcaac3a57570e2bd1545b3f87b6b7ea6186575bb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From 0d69f116136b008d9f613c5a0e88afe18d334f34 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From 302fe78dffbd6be8b5c4a2c69337cfaa294ee443 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index e42840bf6fe4..b1dffd304198 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF
  -DQT_HOST_PATH=/usr/ -DQT_HOST_PATH_CMAKE_DIR=/usr/lib64/cmake/Qt6"

From 1287c91e68e80e8fa07d8af055cf00102c49abea Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..74ccb4dd4592 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,9 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
@@ -13,8 +15,15 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+patch_args="-d ${build_wrksrc} -Np1"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From b85116d3cedeeea96c45aece8707f5cc97d6b613 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 20:25:19 +0100
Subject: [PATCH 26/26] ispc: update to 1.18.1.r290+e88e49e

---
 .../ispc/patches/cmake-build-type-none.patch  |   25 +-
 srcpkgs/ispc/patches/llvm12-001.patch         |   57 -
 srcpkgs/ispc/patches/llvm12-002.patch         |  923 --------
 srcpkgs/ispc/patches/llvm12-003.patch         | 1504 ------------
 srcpkgs/ispc/patches/llvm12-004.patch         |   34 -
 srcpkgs/ispc/patches/llvm12-005.patch         |  372 ---
 srcpkgs/ispc/patches/llvm12-006.patch         |  126 -
 srcpkgs/ispc/patches/llvm12-007.patch         |  160 --
 srcpkgs/ispc/patches/llvm12-008.patch         |  149 --
 srcpkgs/ispc/patches/llvm12-009.patch         | 2109 -----------------
 srcpkgs/ispc/template                         |   13 +-
 11 files changed, 17 insertions(+), 5455 deletions(-)
 delete mode 100644 srcpkgs/ispc/patches/llvm12-001.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-002.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-003.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-004.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-005.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-006.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-007.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-008.patch
 delete mode 100644 srcpkgs/ispc/patches/llvm12-009.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
index 411e353c7314..a962619d9335 100644
--- a/srcpkgs/ispc/patches/cmake-build-type-none.patch
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -1,18 +1,13 @@
-Index: ispc-1.15.0/CMakeLists.txt
-===================================================================
---- ispc-1.15.0.orig/CMakeLists.txt
-+++ ispc-1.15.0/CMakeLists.txt
-@@ -157,13 +157,6 @@ set(OUTPUT_RELEASE Release/bin)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
  
  if(CMAKE_BUILD_TYPE)
--    # Validate build type
+     # Validate build type
 -    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
--
--    string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
--    if (${MATCHED_CONFIG} EQUAL -1)
--         message(FATAL_ERROR "CMAKE_BUILD_TYPE (${CMAKE_BUILD_TYPE}) allows only the following values: ${CONFIGURATION_TYPES}")
--    endif()
- else(NOT CMAKE_BUILD_TYPE)
-     set(CMAKE_BUILD_TYPE "Release")
-     message(STATUS "Build type not specified: Use Release by default.")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/patches/llvm12-001.patch b/srcpkgs/ispc/patches/llvm12-001.patch
deleted file mode 100644
index 5f2d3f5a409e..000000000000
--- a/srcpkgs/ispc/patches/llvm12-001.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 1c0f89dccb774f216c7f6e76a99ee907a1e641cb Mon Sep 17 00:00:00 2001
-From: Dmitry Babokin <dmitry.y.babokin@intel.com>
-Date: Tue, 22 Dec 2020 17:03:59 -0800
-Subject: [PATCH] Fix to work with LLVM trunk after llvm/llvm-project@41c3b2713
-
----
- src/ctx.cpp | 18 ++++++++++++------
- 1 file changed, 12 insertions(+), 6 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 6fbb8b9cf..977e9d222 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1473,11 +1473,15 @@ void FunctionEmitContext::AddDebugPos(llvm::Value *value, const SourcePos *pos,
-     llvm::Instruction *inst = llvm::dyn_cast<llvm::Instruction>(value);
-     if (inst != NULL && m->diBuilder) {
-         SourcePos p = pos ? *pos : currentPos;
--        if (p.first_line != 0)
-+        if (p.first_line != 0) {
-             // If first_line == 0, then we're in the middle of setting up
-             // the standard library or the like; don't add debug positions
-             // for those functions
--            inst->setDebugLoc(llvm::DebugLoc::get(p.first_line, p.first_column, scope ? scope : GetDIScope()));
-+            scope = scope ? scope : GetDIScope();
-+            llvm::DebugLoc diLoc =
-+                llvm::DILocation::get(scope->getContext(), p.first_line, p.first_column, scope, nullptr, false);
-+            inst->setDebugLoc(diLoc);
-+        }
-     }
- }
- 
-@@ -1518,9 +1522,10 @@ void FunctionEmitContext::EmitVariableDebugInfo(Symbol *sym) {
-     llvm::DILocalVariable *var = m->diBuilder->createAutoVariable(
-         scope, sym->name, sym->pos.GetDIFile(), sym->pos.first_line, diType, true /* preserve through opts */);
- 
-+    llvm::DebugLoc diLoc =
-+        llvm::DILocation::get(scope->getContext(), sym->pos.first_line, sym->pos.first_column, scope, nullptr, false);
-     llvm::Instruction *declareInst =
--        m->diBuilder->insertDeclare(sym->storagePtr, var, m->diBuilder->createExpression(),
--                                    llvm::DebugLoc::get(sym->pos.first_line, sym->pos.first_column, scope), bblock);
-+        m->diBuilder->insertDeclare(sym->storagePtr, var, m->diBuilder->createExpression(), diLoc, bblock);
-     AddDebugPos(declareInst, &sym->pos, scope);
- }
- 
-@@ -1535,9 +1540,10 @@ void FunctionEmitContext::EmitFunctionParameterDebugInfo(Symbol *sym, int argNum
-         m->diBuilder->createParameterVariable(scope, sym->name, argNum + 1, sym->pos.GetDIFile(), sym->pos.first_line,
-                                               diType, true /* preserve through opts */, flags);
- 
-+    llvm::DebugLoc diLoc =
-+        llvm::DILocation::get(scope->getContext(), sym->pos.first_line, sym->pos.first_column, scope, nullptr, false);
-     llvm::Instruction *declareInst =
--        m->diBuilder->insertDeclare(sym->storagePtr, var, m->diBuilder->createExpression(),
--                                    llvm::DebugLoc::get(sym->pos.first_line, sym->pos.first_column, scope), bblock);
-+        m->diBuilder->insertDeclare(sym->storagePtr, var, m->diBuilder->createExpression(), diLoc, bblock);
-     AddDebugPos(declareInst, &sym->pos, scope);
- }
- 
diff --git a/srcpkgs/ispc/patches/llvm12-002.patch b/srcpkgs/ispc/patches/llvm12-002.patch
deleted file mode 100644
index 0903f30da10d..000000000000
--- a/srcpkgs/ispc/patches/llvm12-002.patch
+++ /dev/null
@@ -1,923 +0,0 @@
-From 0597a79d084c014780136da906afe21d15e982cb Mon Sep 17 00:00:00 2001
-From: DeepakRajendrakumaran <deepak.rajendrakumaran@intel.com>
-Date: Tue, 5 Jan 2021 13:53:30 -0800
-Subject: [PATCH] Remove LLVM 8.0 and LLVM 9.0. (#1966)
-
----
- .appveyor.yml                        |  3 --
- .travis.yml                          |  7 ---
- CMakeLists.txt                       | 12 ++----
- src/ast.cpp                          |  4 --
- src/ctx.cpp                          | 30 -------------
- src/gen/GlobalsLocalization.cpp      |  4 --
- src/ispc.cpp                         | 20 ---------
- src/ispc.h                           |  3 +-
- src/ispc_version.h                   |  4 +-
- src/main.cpp                         | 13 ------
- src/module.cpp                       | 27 ------------
- src/module.h                         |  2 -
- src/opt.cpp                          | 64 ++--------------------------
- src/type.cpp                         | 10 ++---
- tests/lit-tests/1771.ispc            |  1 -
- tests/lit-tests/1844.ispc            |  3 --
- tests/lit-tests/1926.ispc            |  2 -
- tests/lit-tests/cpus_x86.ispc        |  2 +
- tests/lit-tests/cpus_x86_llvm10.ispc | 11 -----
- tests/lit-tests/lit.cfg              |  5 ---
- 20 files changed, 14 insertions(+), 213 deletions(-)
- delete mode 100644 tests/lit-tests/cpus_x86_llvm10.ispc
-
-diff --git a/.appveyor.yml b/.appveyor.yml
-index 451a7b3e0..7945cca2a 100644
---- a/.appveyor.yml
-+++ b/.appveyor.yml
-@@ -41,8 +41,6 @@ environment:
-       LLVM_VERSION: latest
-     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
-       LLVM_VERSION: 10.0
--    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
--      LLVM_VERSION: 9.0
- 
- for:
- -
-@@ -62,7 +60,6 @@ for:
-         if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( (set generator="Visual Studio 16") & (set vsversion=2019))
-         set LLVM_TAR=llvm-11.0.0-win.vs2019-Release+Asserts-x86.arm.wasm.7z
-         if "%LLVM_VERSION%"=="10.0" (set LLVM_TAR=llvm-10.0.1-win.vs2019-Release+Asserts-x86.arm.wasm.zip)
--        if "%LLVM_VERSION%"=="9.0" (set LLVM_TAR=llvm-9.0.1-win.vs2017-Release+Asserts-x86.arm.wasm.zip)
-   install:
-     - ps: choco install --no-progress winflexbison3 wget 7zip
-     - cmd: |-
-diff --git a/.travis.yml b/.travis.yml
-index 2e96017a6..3a6b85264 100644
---- a/.travis.yml
-+++ b/.travis.yml
-@@ -108,13 +108,6 @@ jobs:
-         - LLVM_TAR=llvm-10.0.1-ubuntu16.04-Release+Asserts-x86.arm.wasm.tar.xz
-         - LLVM_REPO=https://github.com/dbabokin/llvm-project
-         - ISPC_HOME=$TRAVIS_BUILD_DIR
--    # LLVM 9.0 + Ubuntu 16.04: build, lit tests, examples (build + run), benchmarks (build + trial run)
--    - <<: *my_tag
--      env:
--        - LLVM_VERSION=9.0 OS=Ubuntu16.04
--        - LLVM_TAR=llvm-9.0.1-ubuntu16.04-Release+Asserts-x86.arm.wasm.tar.xz
--        - LLVM_REPO=https://github.com/dbabokin/llvm-project
--        - ISPC_HOME=$TRAVIS_BUILD_DIR
-     # WASM enabled build
-     # LLVM 11.0 + Ubuntu 16.04: build, lit tests, examples (build), benchmarks (build + trial run)
-     - <<: *my_tag
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 5fa863fcf..a6b3ed251 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -241,10 +241,8 @@ if (X86_ENABLED)
-         avx2-i8x32 avx2-i16x16
-         avx2-i32x4 avx2-i32x8 avx2-i32x16 avx2-i64x4
-         avx512knl-i32x16
--        avx512skx-i32x16 avx512skx-i32x8)
--    if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
--        list(APPEND ISPC_TARGETS avx512skx-i8x64 avx512skx-i16x32)
--    endif()
-+        avx512skx-i32x16 avx512skx-i32x8
-+        avx512skx-i8x64 avx512skx-i16x32)
- endif()
- if (ARM_ENABLED)
-     list(APPEND ISPC_TARGETS neon-i8x16 neon-i16x8 neon-i32x4 neon-i32x8)
-@@ -259,11 +257,7 @@ if (WASM_ENABLED)
- endif()
- 
- set(CLANG_LIBRARY_LIST clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangAST clangBasic clangEdit clangLex)
--set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option)
--
--if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
--    list(APPEND LLVM_COMPONENTS frontendopenmp)
--endif()
-+set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option frontendopenmp)
- 
- if (X86_ENABLED)
-     list(APPEND LLVM_COMPONENTS x86)
-diff --git a/src/ast.cpp b/src/ast.cpp
-index 20f75a29c..5a43c4854 100644
---- a/src/ast.cpp
-+++ b/src/ast.cpp
-@@ -44,9 +44,7 @@
- #include "sym.h"
- #include "util.h"
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
- #include <llvm/Support/TimeProfiler.h>
--#endif
- ///////////////////////////////////////////////////////////////////////////
- // ASTNode
- 
-@@ -62,9 +60,7 @@ void AST::AddFunction(Symbol *sym, Stmt *code) {
- }
- 
- void AST::GenerateIR() {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope TimeScope("GenerateIR");
--#endif
-     for (unsigned int i = 0; i < functions.size(); ++i)
-         functions[i]->GenerateIR();
- }
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 977e9d222..42c4ea09d 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -309,21 +309,13 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym, llvm::F
-             char buf[256];
-             snprintf(buf, sizeof(buf), "__off_all_on_mask_%s", g->target->GetISAString());
- 
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_8_0
--            llvm::Constant *offFunc = m->module->getOrInsertFunction(buf, LLVMTypes::VoidType);
--#else // LLVM 9.0+
-             llvm::FunctionCallee offFuncCallee = m->module->getOrInsertFunction(buf, LLVMTypes::VoidType);
-             llvm::Constant *offFunc = llvm::cast<llvm::Constant>(offFuncCallee.getCallee());
--#endif
-             AssertPos(currentPos, llvm::isa<llvm::Function>(offFunc));
-             llvm::BasicBlock *offBB = llvm::BasicBlock::Create(*g->ctx, "entry", (llvm::Function *)offFunc, 0);
-             llvm::StoreInst *inst = new llvm::StoreInst(LLVMMaskAllOff, globalAllOnMaskPtr, offBB);
-             if (g->opt.forceAlignedMemory) {
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                inst->setAlignment(g->target->getNativeVectorAlignment());
--#else // LLVM 10.0+
-                 inst->setAlignment(llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne());
--#endif
-             }
-             llvm::ReturnInst::Create(*g->ctx, offBB);
-         }
-@@ -2288,11 +2280,7 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, c
- #endif
- 
-     if (g->opt.forceAlignedMemory && llvm::dyn_cast<llvm::VectorType>(pt->getElementType())) {
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--        inst->setAlignment(g->target->getNativeVectorAlignment());
--#else // LLVM 10.0+
-         inst->setAlignment(llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne());
--#endif
-     }
- 
-     AddDebugPos(inst);
-@@ -2431,11 +2419,7 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
-                 // vs the proper alignment in practice.)
-                 int align = 1;
- 
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                inst->setAlignment(align);
--#else // LLVM 10.0+
-                 inst->setAlignment(llvm::MaybeAlign(align).valueOrOne());
--#endif
-             }
- 
-             AddDebugPos(inst);
-@@ -2649,11 +2633,7 @@ llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const char *n
-         align = g->target->getNativeVectorAlignment();
- 
-     if (align != 0) {
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--        inst->setAlignment(align);
--#else // LLVM 10.0+
-         inst->setAlignment(llvm::MaybeAlign(align).valueOrOne());
--#endif
-     }
-     // Don't add debugging info to alloca instructions
-     return inst;
-@@ -2926,11 +2906,7 @@ void FunctionEmitContext::StoreInst(llvm::Value *value, llvm::Value *ptr, const
-     llvm::StoreInst *inst = new llvm::StoreInst(value, ptr, bblock);
- 
-     if (g->opt.forceAlignedMemory && llvm::dyn_cast<llvm::VectorType>(pt->getElementType())) {
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--        inst->setAlignment(g->target->getNativeVectorAlignment());
--#else // LLVM 10.0+
-         inst->setAlignment(llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne());
--#endif
-     }
- 
- #ifdef ISPC_GENX_ENABLED
-@@ -3025,16 +3001,10 @@ void FunctionEmitContext::MemcpyInst(llvm::Value *dest, llvm::Value *src, llvm::
-     }
-     if (align == NULL)
-         align = LLVMInt32(1);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_8_0
--    llvm::Constant *mcFunc =
--        m->module->getOrInsertFunction("llvm.memcpy.p0i8.p0i8.i64", LLVMTypes::VoidType, LLVMTypes::VoidPointerType,
--                                       LLVMTypes::VoidPointerType, LLVMTypes::Int64Type, LLVMTypes::BoolType);
--#else // LLVM 9.0+
-     llvm::FunctionCallee mcFuncCallee =
-         m->module->getOrInsertFunction("llvm.memcpy.p0i8.p0i8.i64", LLVMTypes::VoidType, LLVMTypes::VoidPointerType,
-                                        LLVMTypes::VoidPointerType, LLVMTypes::Int64Type, LLVMTypes::BoolType);
-     llvm::Constant *mcFunc = llvm::cast<llvm::Constant>(mcFuncCallee.getCallee());
--#endif
-     AssertPos(currentPos, mcFunc != NULL);
-     AssertPos(currentPos, llvm::isa<llvm::Function>(mcFunc));
- 
-diff --git a/src/gen/GlobalsLocalization.cpp b/src/gen/GlobalsLocalization.cpp
-index 193a66289..a176e9462 100644
---- a/src/gen/GlobalsLocalization.cpp
-+++ b/src/gen/GlobalsLocalization.cpp
-@@ -470,11 +470,7 @@ void GlobalsLocalization::LocalizeGlobals(LocalizationInfo &LI) {
-         Instruction &FirstI = *Fn->getEntryBlock().begin();
-         Type *ElemTy = GV->getType()->getElementType();
-         AllocaInst *Alloca = new AllocaInst(ElemTy, 0, GV->getName() + ".local", &FirstI);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--        Alloca->setAlignment(GV->getAlignment());
--#else // LLVM 10.0+
-         Alloca->setAlignment(llvm::MaybeAlign(GV->getAlignment()));
--#endif
-         if (!isa<UndefValue>(GV->getInitializer()))
-             new StoreInst(GV->getInitializer(), Alloca, &FirstI);
- 
-diff --git a/src/ispc.cpp b/src/ispc.cpp
-index e2d0f206e..fac5233f7 100644
---- a/src/ispc.cpp
-+++ b/src/ispc.cpp
-@@ -272,9 +272,7 @@ typedef enum {
-     CPU_Silvermont,
- 
-     CPU_ICX,
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     CPU_TGL,
--#endif
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_12_0
-     CPU_ADL,
-     CPU_SPR,
-@@ -365,10 +363,8 @@ class AllCPUs {
- 
-         names[CPU_ICX].push_back("icelake-server");
-         names[CPU_ICX].push_back("icx");
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         names[CPU_TGL].push_back("tigerlake");
-         names[CPU_TGL].push_back("tgl");
--#endif
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_12_0
-         names[CPU_ADL].push_back("alderlake");
-         names[CPU_ADL].push_back("adl");
-@@ -411,11 +407,9 @@ class AllCPUs {
-         compat[CPU_ADL] = Set(CPU_ADL, CPU_x86_64, CPU_Bonnell, CPU_Penryn, CPU_Core2, CPU_Nehalem, CPU_Silvermont,
-                               CPU_SandyBridge, CPU_IvyBridge, CPU_Haswell, CPU_Broadwell, CPU_None);
- #endif
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         compat[CPU_TGL] =
-             Set(CPU_TGL, CPU_x86_64, CPU_Bonnell, CPU_Penryn, CPU_Core2, CPU_Nehalem, CPU_Silvermont, CPU_SandyBridge,
-                 CPU_IvyBridge, CPU_Haswell, CPU_Broadwell, CPU_SKX, CPU_ICL, CPU_ICX, CPU_None);
--#endif
-         compat[CPU_ICX] = Set(CPU_ICX, CPU_x86_64, CPU_Bonnell, CPU_Penryn, CPU_Core2, CPU_Nehalem, CPU_Silvermont,
-                               CPU_SandyBridge, CPU_IvyBridge, CPU_Haswell, CPU_Broadwell, CPU_SKX, CPU_ICL, CPU_None);
- 
-@@ -556,9 +550,7 @@ Target::Target(Arch arch, const char *cpu, ISPCTarget ispc_target, bool pic, boo
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_12_0
-         case CPU_SPR:
- #endif
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         case CPU_TGL:
--#endif
-         case CPU_ICX:
-         case CPU_ICL:
-         case CPU_SKX:
-@@ -916,7 +908,6 @@ Target::Target(Arch arch, const char *cpu, ISPCTarget ispc_target, bool pic, boo
-         }
-         break;
-     case ISPCTarget::avx512skx_i8x64:
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0 // LLVM 10.0+
-         // This target is enabled only for LLVM 10.0 and later
-         // because LLVM requires a number of fixes, which are
-         // committed to LLVM 11.0 and can be applied to 10.0, but not
-@@ -937,12 +928,7 @@ Target::Target(Arch arch, const char *cpu, ISPCTarget ispc_target, bool pic, boo
-         this->m_hasVecPrefetch = false;
-         CPUfromISA = CPU_SKX;
-         break;
--#else
--        unsupported_target = true;
--        break;
--#endif
-     case ISPCTarget::avx512skx_i16x32:
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0 // LLVM 10.0+
-         // This target is enabled only for LLVM 10.0 and later
-         // because LLVM requires a number of fixes, which are
-         // committed to LLVM 11.0 and can be applied to 10.0, but not
-@@ -963,10 +949,6 @@ Target::Target(Arch arch, const char *cpu, ISPCTarget ispc_target, bool pic, boo
-         this->m_hasVecPrefetch = false;
-         CPUfromISA = CPU_SKX;
-         break;
--#else
--        unsupported_target = true;
--        break;
--#endif
- #ifdef ISPC_ARM_ENABLED
-     case ISPCTarget::neon_i8x16:
-         this->m_isa = Target::NEON;
-@@ -1662,11 +1644,9 @@ Globals::Globals() {
-     isMultiTargetCompilation = false;
-     errorLimit = -1;
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     enableTimeTrace = false;
-     // set default granularity to 500.
-     timeTraceGranularity = 500;
--#endif
-     target = NULL;
-     ctx = new llvm::LLVMContext;
- 
-diff --git a/src/ispc.h b/src/ispc.h
-index e25d8830e..de357a21c 100644
---- a/src/ispc.h
-+++ b/src/ispc.h
-@@ -695,13 +695,12 @@ struct Globals {
- 
-     /* Number of errors to show in ISPC. */
-     int errorLimit;
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-+
-     /* When true, enable compile time tracing. */
-     bool enableTimeTrace;
- 
-     /* When compile time tracing is enabled, set time granularity. */
-     int timeTraceGranularity;
--#endif
- };
- 
- enum {
-diff --git a/src/ispc_version.h b/src/ispc_version.h
-index d781347fd..434b2d678 100644
---- a/src/ispc_version.h
-+++ b/src/ispc_version.h
-@@ -44,13 +44,11 @@
- 
- #define ISPC_LLVM_VERSION (LLVM_VERSION_MAJOR * 10000 + LLVM_VERSION_MINOR * 100)
- 
--#define ISPC_LLVM_8_0 80000
--#define ISPC_LLVM_9_0 90000
- #define ISPC_LLVM_10_0 100000
- #define ISPC_LLVM_11_0 110000
- #define ISPC_LLVM_12_0 120000
- 
--#define OLDEST_SUPPORTED_LLVM ISPC_LLVM_8_0
-+#define OLDEST_SUPPORTED_LLVM ISPC_LLVM_10_0
- #define LATEST_SUPPORTED_LLVM ISPC_LLVM_12_0
- 
- #ifdef __ispc__xstr
-diff --git a/src/main.cpp b/src/main.cpp
-index 8f64330cc..5c920eabc 100644
---- a/src/main.cpp
-+++ b/src/main.cpp
-@@ -55,9 +55,7 @@
- #include <llvm/Support/Signals.h>
- #include <llvm/Support/TargetRegistry.h>
- #include <llvm/Support/TargetSelect.h>
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
- #include <llvm/Support/ToolOutputFile.h>
--#endif
- 
- #ifdef ISPC_HOST_IS_WINDOWS
- #define strcasecmp stricmp
-@@ -181,11 +179,9 @@ static void lPrintVersion() {
-     snprintf(targetHelp, sizeof(targetHelp), "[--target-os=<os>]\t\t\tSelect target OS.  <os>={%s}",
-              g->target_registry->getSupportedOSes().c_str());
-     PrintWithWordBreaks(targetHelp, 24, TerminalWidth(), stdout);
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     printf("    [--time-trace]\t\t\tTurn on time profiler. Generates JSON file based on output filename.\n");
-     printf("    [--time-trace-granularity=<value>\tMinimum time granularity (in microseconds) traced by time "
-            "profiler.\n");
--#endif
-     printf("    [--version]\t\t\t\tPrint ispc version\n");
- #ifdef ISPC_GENX_ENABLED
-     printf("    [--vc-options=<\"-option1 -option2...\">]\t\t\t\tPass additional options to Vector Compiler backend\n");
-@@ -462,7 +458,6 @@ static void setCallingConv(VectorCallStatus vectorCall, Arch arch) {
-     }
- }
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
- static void writeCompileTimeFile(const char *outFileName) {
-     llvm::SmallString<128> jsonFileName(outFileName);
-     jsonFileName.append(".json");
-@@ -479,7 +474,6 @@ static void writeCompileTimeFile(const char *outFileName) {
-     of->keep();
-     return;
- }
--#endif
- 
- static std::set<int> ParsingPhases(char *stages, ArgErrors &errorHandler) {
-     constexpr int parsing_limit = 100;
-@@ -791,12 +785,10 @@ int main(int Argc, char *Argv[]) {
-             }
-         } else if (!strncmp(argv[i], "--force-alignment=", 18)) {
-             g->forceAlignment = atoi(argv[i] + 18);
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         } else if (!strcmp(argv[i], "--time-trace")) {
-             g->enableTimeTrace = true;
-         } else if (!strncmp(argv[i], "--time-trace-granularity=", 25)) {
-             g->timeTraceGranularity = atoi(argv[i] + 25);
--#endif
-         } else if (!strcmp(argv[i], "--woff") || !strcmp(argv[i], "-woff")) {
-             g->disableWarnings = true;
-             g->emitPerfWarnings = false;
-@@ -1059,7 +1051,6 @@ int main(int Argc, char *Argv[]) {
- 
-     // This needs to happen after the TargetOS is decided.
-     setCallingConv(vectorCall, arch);
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     if (g->enableTimeTrace) {
-         llvm::timeTraceProfilerInitialize(g->timeTraceGranularity, "ispc");
-     }
-@@ -1077,9 +1068,5 @@ int main(int Argc, char *Argv[]) {
-         }
-         llvm::timeTraceProfilerCleanup();
-     }
--#else
--    int ret = Module::CompileAndOutput(file, arch, cpu, targets, flags, ot, outFileName, headerFileName, depsFileName,
--                                       depsTargetName, hostStubFileName, devStubFileName);
--#endif
-     return ret;
- }
-diff --git a/src/module.cpp b/src/module.cpp
-index fe7452df1..a85fec77a 100644
---- a/src/module.cpp
-+++ b/src/module.cpp
-@@ -170,9 +170,7 @@ Module::Module(const char *fn) {
-     module->setDataLayout(g->target->getDataLayout()->getStringRepresentation());
- 
-     if (g->generateDebuggingSymbols) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         llvm::TimeTraceScope TimeScope("Create Debug Data");
--#endif
-         // To enable debug information on Windows, we have to let llvm know, that
-         // debug information should be emitted in CodeView format.
-         if (g->target_os == TargetOS::windows) {
-@@ -226,10 +224,8 @@ extern YY_BUFFER_STATE yy_create_buffer(FILE *, int);
- extern void yy_delete_buffer(YY_BUFFER_STATE);
- 
- int Module::CompileFile() {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope CompileFileTimeScope(
-         "CompileFile", llvm::StringRef(filename + ("_" + std::string(g->target->GetISAString()))));
--#endif
-     extern void ParserInit();
-     ParserInit();
- 
-@@ -238,18 +234,14 @@ int Module::CompileFile() {
-     // variable 'm' to be initialized and available (which it isn't until
-     // the Module constructor returns...)
-     {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         llvm::TimeTraceScope TimeScope("DefineStdlib");
--#endif
-         DefineStdlib(symbolTable, g->ctx, module, g->includeStdlib);
-     }
- 
-     bool runPreprocessor = g->runCPP;
- 
-     if (runPreprocessor) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         llvm::TimeTraceScope TimeScope("Frontend parser");
--#endif
-         if (!IsStdin(filename)) {
-             // Try to open the file first, since otherwise we crash in the
-             // preprocessor if the file doesn't exist.
-@@ -268,9 +260,7 @@ int Module::CompileFile() {
-         yyparse();
-         yy_delete_buffer(strbuf);
-     } else {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-         llvm::TimeTraceScope TimeScope("Frontend parser");
--#endif
-         // No preprocessor, just open up the file if it's not stdin..
-         FILE *f = NULL;
-         if (IsStdin(filename)) {
-@@ -297,9 +287,7 @@ int Module::CompileFile() {
- 
-     if (diBuilder)
-         diBuilder->finalize();
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope TimeScope("Optimize");
--#endif
-     if (errorCount == 0)
-         Optimize(module, g->opt.level);
- 
-@@ -1243,15 +1231,8 @@ bool Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, llvm:
-                                        const char *outFileName) {
-     // Figure out if we're generating object file or assembly output, and
-     // set binary output for object files
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--    Assert(!g->target->isGenXTarget());
--    llvm::TargetMachine::CodeGenFileType fileType =
--        (outputType == Object) ? llvm::TargetMachine::CGFT_ObjectFile : llvm::TargetMachine::CGFT_AssemblyFile;
--    bool binary = (fileType == llvm::TargetMachine::CGFT_ObjectFile);
--#else // LLVM 10.0+
-     llvm::CodeGenFileType fileType = (outputType == Object) ? llvm::CGFT_ObjectFile : llvm::CGFT_AssemblyFile;
-     bool binary = (fileType == llvm::CGFT_ObjectFile);
--#endif
- 
-     llvm::sys::fs::OpenFlags flags = binary ? llvm::sys::fs::F_None : llvm::sys::fs::F_Text;
- 
-@@ -2219,11 +2200,7 @@ void Module::execPreprocessor(const char *infilename, llvm::raw_string_ostream *
-     inst.setTarget(target);
-     inst.createSourceManager(inst.getFileManager());
- 
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--    clang::FrontendInputFile inputFile(infilename, clang::InputKind::Unknown);
--#else // LLVM 10.0+
-     clang::FrontendInputFile inputFile(infilename, clang::InputKind());
--#endif
- 
-     inst.InitializeSourceManager(inputFile);
- 
-@@ -2722,9 +2699,7 @@ int Module::CompileAndOutput(const char *srcFile, Arch arch, const char *cpu, st
- 
-         m = new Module(srcFile);
-         if (m->CompileFile() == 0) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-             llvm::TimeTraceScope TimeScope("Backend");
--#endif
- #ifdef ISPC_GENX_ENABLED
-             if (outputType == Asm || outputType == Object) {
-                 if (g->target->isGenXTarget()) {
-@@ -2855,9 +2830,7 @@ int Module::CompileAndOutput(const char *srcFile, Arch arch, const char *cpu, st
- 
-             m = new Module(srcFile);
-             int compileFileError = m->CompileFile();
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-             llvm::TimeTraceScope TimeScope("Backend");
--#endif
-             if (compileFileError == 0) {
-                 // Create the dispatch module, unless already created;
-                 // in the latter case, just do the checking
-diff --git a/src/module.h b/src/module.h
-index 61d3cfea0..603124d50 100644
---- a/src/module.h
-+++ b/src/module.h
-@@ -43,9 +43,7 @@
- 
- #include <llvm/IR/DebugInfo.h>
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
- #include <llvm/Support/TimeProfiler.h>
--#endif
- 
- #ifdef ISPC_GENX_ENABLED
- #include "ocl_igc_interface/igc_ocl_device_ctx.h"
-diff --git a/src/opt.cpp b/src/opt.cpp
-index a655a8344..5b1ac7b63 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -66,6 +66,7 @@
- #include <llvm/IR/Instructions.h>
- #include <llvm/IR/IntrinsicInst.h>
- #include <llvm/IR/Intrinsics.h>
-+#include <llvm/IR/IntrinsicsX86.h>
- #include <llvm/IR/LegacyPassManager.h>
- #include <llvm/IR/Module.h>
- #include <llvm/IR/PatternMatch.h>
-@@ -85,9 +86,6 @@
- #include <llvm/Transforms/Scalar/InstSimplifyPass.h>
- #include <llvm/Transforms/Utils.h>
- #include <llvm/Transforms/Utils/BasicBlockUtils.h>
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
--#include <llvm/IR/IntrinsicsX86.h>
--#endif
- 
- #ifdef ISPC_HOST_IS_LINUX
- #include <alloca.h>
-@@ -1003,10 +1001,7 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 else
-                     align = callInst->getCalledFunction() == avxMaskedLoad32 ? 4 : 8;
-                 name = LLVMGetName(callInst->getArgOperand(0), "_load");
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                llvm::Instruction *loadInst =
--                    new llvm::LoadInst(castPtr, name, false /* not volatile */, align, (llvm::Instruction *)NULL);
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-                 llvm::Instruction *loadInst = new llvm::LoadInst(castPtr, name, false /* not volatile */,
-                                                                  llvm::MaybeAlign(align), (llvm::Instruction *)NULL);
- #else
-@@ -1043,13 +1038,8 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                     align = g->target->getNativeVectorAlignment();
-                 else
-                     align = callInst->getCalledFunction() == avxMaskedStore32 ? 4 : 8;
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                llvm::StoreInst *storeInst = new llvm::StoreInst(rvalue, castPtr, (llvm::Instruction *)NULL);
--                storeInst->setAlignment(align);
--#else
-                 llvm::StoreInst *storeInst = new llvm::StoreInst(rvalue, castPtr, (llvm::Instruction *)NULL,
-                                                                  llvm::MaybeAlign(align).valueOrOne());
--#endif
-                 lCopyMetadata(storeInst, callInst);
-                 llvm::ReplaceInstWithInst(callInst, storeInst);
- 
-@@ -1066,9 +1056,7 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool IntrinsicsOpt::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("IntrinsicsOpt::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -1239,9 +1227,7 @@ bool InstructionSimplifyPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool InstructionSimplifyPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("InstructionSimplifyPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -2974,16 +2960,10 @@ static bool lImproveMaskedStore(llvm::CallInst *callInst) {
- 
-             lvalue = new llvm::BitCastInst(lvalue, ptrType, "lvalue_to_ptr_type", callInst);
-             lCopyMetadata(lvalue, callInst);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--            store =
--                new llvm::StoreInst(rvalue, lvalue, false /* not volatile */,
--                                    g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align);
--#else
-             store = new llvm::StoreInst(
-                 rvalue, lvalue, false /* not volatile */,
-                 llvm::MaybeAlign(g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align)
-                     .valueOrOne());
--#endif
-         }
-         if (store != NULL) {
-             lCopyMetadata(store, callInst);
-@@ -3059,11 +3039,7 @@ static bool lImproveMaskedLoad(llvm::CallInst *callInst, llvm::BasicBlock::itera
-         {
-             llvm::Type *ptrType = llvm::PointerType::get(callInst->getType(), 0);
-             ptr = new llvm::BitCastInst(ptr, ptrType, "ptr_cast_for_load", callInst);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--            load = new llvm::LoadInst(ptr, callInst->getName(), false /* not volatile */,
--                                      g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align,
--                                      (llvm::Instruction *)NULL);
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-             load = new llvm::LoadInst(
-                 ptr, callInst->getName(), false /* not volatile */,
-                 llvm::MaybeAlign(g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align)
-@@ -3129,9 +3105,7 @@ bool ImproveMemoryOpsPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ImproveMemoryOpsPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ImproveMemoryOpsPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -3424,9 +3398,7 @@ llvm::Value *lGEPAndLoad(llvm::Value *basePtr, int64_t offset, int align, llvm::
-                          llvm::Type *type) {
-     llvm::Value *ptr = lGEPInst(basePtr, LLVMInt64(offset), "new_base", insertBefore);
-     ptr = new llvm::BitCastInst(ptr, llvm::PointerType::get(type, 0), "ptr_cast", insertBefore);
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--    return new llvm::LoadInst(ptr, "gather_load", false /* not volatile */, align, insertBefore);
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-     return new llvm::LoadInst(ptr, "gather_load", false /* not volatile */, llvm::MaybeAlign(align), insertBefore);
- #else // LLVM 11.0+
-     return new llvm::LoadInst(llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(), ptr,
-@@ -4135,9 +4107,7 @@ bool GatherCoalescePass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool GatherCoalescePass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("GatherCoalescePass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -4467,9 +4437,7 @@ bool ReplacePseudoMemoryOpsPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ReplacePseudoMemoryOpsPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ReplacePseudoMemoryOpsPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -4573,9 +4541,7 @@ bool IsCompileTimeConstantPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool IsCompileTimeConstantPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("IsCompileTimeConstantPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -5201,9 +5167,7 @@ bool PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool PeepholePass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("PeepholePass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -5299,9 +5263,7 @@ bool ReplaceStdlibShiftPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ReplaceStdlibShiftPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ReplaceStdlibShiftPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -5399,9 +5361,7 @@ llvm::Instruction *FixBooleanSelectPass::fixSelect(llvm::SelectInst *sel, llvm::
- }
- 
- bool FixBooleanSelectPass::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("FixBooleanSelectPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
- 
-     return modifiedAny;
-@@ -5964,9 +5924,7 @@ bool GenXGatherCoalescing::runOnBasicBlock(llvm::BasicBlock &bb) {
- }
- 
- bool GenXGatherCoalescing::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("GenXGatherCoalescing::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6113,9 +6071,7 @@ bool PromoteToPrivateMemoryPass::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool PromoteToPrivateMemoryPass::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("PromoteToPrivateMemoryPass::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6181,9 +6137,7 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ReplaceLLVMIntrinsics::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ReplaceLLVMIntrinsics::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6278,9 +6232,7 @@ bool ReplaceUnsupportedInsts::runOnBasicBlock(llvm::BasicBlock &bb) {
- 
- bool ReplaceUnsupportedInsts::runOnFunction(llvm::Function &F) {
- 
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("ReplaceUnsupportedInsts::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6369,9 +6321,7 @@ bool CheckUnsupportedInsts::runOnBasicBlock(llvm::BasicBlock &bb) {
- }
- 
- bool CheckUnsupportedInsts::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("CheckUnsupportedInsts::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6440,9 +6390,7 @@ bool MangleOpenCLBuiltins::runOnBasicBlock(llvm::BasicBlock &bb) {
- }
- 
- bool MangleOpenCLBuiltins::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("MangleOpenCLBuiltins::runOnFunction", F.getName());
--#endif
-     bool modifiedAny = false;
-     for (llvm::BasicBlock &BB : F) {
-         modifiedAny |= runOnBasicBlock(BB);
-@@ -6828,9 +6776,7 @@ bool FixAddressSpace::runOnFunction(llvm::Function &F) {
-     // Transformations are correct when the function is not internal.
-     // This is due to address space calculation algorithm.
-     // TODO: problems can be met in case of Stack Calls
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("FixAddressSpace::runOnFunction", F.getName());
--#endif
-     if (F.getLinkage() == llvm::GlobalValue::LinkageTypes::InternalLinkage)
-         return false;
- 
-@@ -6854,9 +6800,7 @@ class DemotePHIs : public llvm::FunctionPass {
- char DemotePHIs::ID = 0;
- 
- bool DemotePHIs::runOnFunction(llvm::Function &F) {
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_10_0
-     llvm::TimeTraceScope FuncScope("DemotePHIs::runOnFunction", F.getName());
--#endif
-     if (F.isDeclaration() || skipFunction(F))
-         return false;
-     std::vector<llvm::Instruction *> WorkList;
-diff --git a/src/type.cpp b/src/type.cpp
-index 688a4e874..fa0cb04db 100644
---- a/src/type.cpp
-+++ b/src/type.cpp
-@@ -1822,14 +1822,10 @@ llvm::DIType *StructType::GetDIType(llvm::DIScope *scope) const {
-     llvm::DIFile *diFile = pos.GetDIFile();
-     llvm::DINamespace *diSpace = pos.GetDINamespace();
-     return m->diBuilder->createStructType(diSpace, GetString(), diFile,
--                                          pos.first_line,          // Line number
--                                          layout->getSizeInBits(), // Size in bits
--#if ISPC_LLVM_VERSION <= ISPC_LLVM_9_0
--                                          layout->getAlignment() * 8, // Alignment in bits
--#else                                                                 // LLVM 10.0+
-+                                          pos.first_line,                     // Line number
-+                                          layout->getSizeInBits(),            // Size in bits
-                                           layout->getAlignment().value() * 8, // Alignment in bits
--#endif
--                                          llvm::DINode::FlagZero, // Flags
-+                                          llvm::DINode::FlagZero,             // Flags
-                                           NULL, elements);
- }
- 
-diff --git a/tests/lit-tests/1771.ispc b/tests/lit-tests/1771.ispc
-index 98064d84d..4feb73dd7 100644
---- a/tests/lit-tests/1771.ispc
-+++ b/tests/lit-tests/1771.ispc
-@@ -5,7 +5,6 @@
- // RUN: %{ispc} %s --target=sse4-i16x8 --emit-asm -o - | FileCheck %s -check-prefix=CHECKSSE4_I16X8
- // RUN: %{ispc} %s --target=sse4-i8x16 --emit-asm -o - | FileCheck %s -check-prefix=CHECKSSE4_I8X16
- 
--// REQUIRES: LLVM_10_0+
- // REQUIRES: X86_ENABLED
- 
- // CHECKAVX2_I32X8: {{[a-z]*xor[a-z]*}}  %xmm0, %xmm0, %xmm0
-diff --git a/tests/lit-tests/1844.ispc b/tests/lit-tests/1844.ispc
-index 793a8866c..189edf4c3 100644
---- a/tests/lit-tests/1844.ispc
-+++ b/tests/lit-tests/1844.ispc
-@@ -6,9 +6,6 @@
- 
- // REQUIRES: X86_ENABLED
- 
--// It doesn't work for anything earlier than 10.0, but it will not be fixed, so don't run.
--// REQUIRES: LLVM_10_0+
--
- extern uniform unsigned int64 var_6;
- extern uniform unsigned int16 var_11;
- extern uniform bool arr_201 [1] [15] [20];
-diff --git a/tests/lit-tests/1926.ispc b/tests/lit-tests/1926.ispc
-index 70f7cc3c2..7921c91a6 100644
---- a/tests/lit-tests/1926.ispc
-+++ b/tests/lit-tests/1926.ispc
-@@ -2,8 +2,6 @@
- // RUN: cat %T/1926.o.json \
- // RUN:   | FileCheck %s
- 
--// REQUIRES: LLVM_10_0+
--
- // CHECK: "traceEvents"
- // CHECK: "detail"
- export uniform int foo(uniform int a[], uniform int count) {
-diff --git a/tests/lit-tests/cpus_x86.ispc b/tests/lit-tests/cpus_x86.ispc
-index 516efdd4c..4d60186f6 100644
---- a/tests/lit-tests/cpus_x86.ispc
-+++ b/tests/lit-tests/cpus_x86.ispc
-@@ -24,6 +24,8 @@
- //; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=icl
- //; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=icelake-server
- //; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=icx
-+//; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=tigerlake
-+//; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=tgl
- 
- // REQUIRES: X86_ENABLED
- 
-diff --git a/tests/lit-tests/cpus_x86_llvm10.ispc b/tests/lit-tests/cpus_x86_llvm10.ispc
-deleted file mode 100644
-index ef00000e5..000000000
---- a/tests/lit-tests/cpus_x86_llvm10.ispc
-+++ /dev/null
-@@ -1,11 +0,0 @@
--// The test checks that cpu definitions (including all synonyms) are successfully consumed by compiler.
--
--//; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=tigerlake
--//; RUN: %{ispc} %s -o %t.o --nostdlib --target=sse2-i32x4 --cpu=tgl
--
--// REQUIRES: X86_ENABLED
--// REQUIRES: LLVM_10_0+
--
--uniform int i;
--
--void foo() {}
-diff --git a/tests/lit-tests/lit.cfg b/tests/lit-tests/lit.cfg
-index 17016579d..045e69437 100644
---- a/tests/lit-tests/lit.cfg
-+++ b/tests/lit-tests/lit.cfg
-@@ -30,11 +30,6 @@ print("Config:")
- 
- # LLVM version
- llvm_version = LooseVersion(ispc_llvm_version_number)
--if llvm_version >= LooseVersion("10.0.0"):
--    print("LLVM_10_0+: YES")
--    config.available_features.add("LLVM_10_0+")
--else:
--    print("LLVM_10_0+: NO")
- 
- if llvm_version >= LooseVersion("12.0.0"):
-     print("LLVM_12_0+: YES")
diff --git a/srcpkgs/ispc/patches/llvm12-003.patch b/srcpkgs/ispc/patches/llvm12-003.patch
deleted file mode 100644
index 0423afc9e3f9..000000000000
--- a/srcpkgs/ispc/patches/llvm12-003.patch
+++ /dev/null
@@ -1,1504 +0,0 @@
-From 1851d18b213dbad169937076176b2d5509733c76 Mon Sep 17 00:00:00 2001
-From: Deepak Rajendrakumaran <deepak.rajendrakumaran@intel.com>
-Date: Tue, 12 Jan 2021 22:15:12 -0800
-Subject: [PATCH] fixes #1821 - Removing LLVMGetName() and switching to
- LLVM::Twine.
-
----
- src/ctx.cpp      | 304 ++++++++++++++++++++++-------------------------
- src/ctx.h        |  72 +++++------
- src/expr.cpp     |  36 +++---
- src/llvmutil.cpp |  17 ---
- src/llvmutil.h   |   5 -
- src/opt.cpp      | 103 +++++++++-------
- 6 files changed, 255 insertions(+), 282 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 42c4ea09d..ded524b71 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1020,8 +1020,8 @@ void FunctionEmitContext::EmitCaseLabel(int value, bool checkMask, SourcePos pos
-     llvm::BasicBlock *bbCaseImpl = NULL;
-     if (emitGenXHardwareMask()) {
-         // Create basic block with actual case implementation
--        std::string bbName = bbCase->getName().str() + "_impl";
--        bbCaseImpl = CreateBasicBlock(bbName.c_str(), bbCase);
-+        llvm::Twine bbName = llvm::Twine(bbCase->getName()) + "_impl";
-+        bbCaseImpl = CreateBasicBlock(bbName, bbCase);
-     }
- #endif
- 
-@@ -1185,7 +1185,7 @@ bool FunctionEmitContext::initLabelBBlocks(ASTNode *node, void *data) {
-     if (ctx->labelMap.find(ls->name) != ctx->labelMap.end())
-         Error(ls->pos, "Multiple labels named \"%s\" in function.", ls->name.c_str());
-     else {
--        llvm::BasicBlock *bb = ctx->CreateBasicBlock(ls->name.c_str());
-+        llvm::BasicBlock *bb = ctx->CreateBasicBlock(ls->name);
-         ctx->labelMap[ls->name] = bb;
-     }
-     return true;
-@@ -1299,7 +1299,7 @@ llvm::Value *FunctionEmitContext::Any(llvm::Value *mask) {
-     // We can actually call either one, since both are i32s as far as
-     // LLVM's type system is concerned...
-     llvm::Function *fmm = mm[0]->function;
--    return CallInst(fmm, NULL, mask, LLVMGetName(mask, "_any"));
-+    return CallInst(fmm, NULL, mask, llvm::Twine(mask->getName()) + "_any");
- }
- 
- llvm::Value *FunctionEmitContext::All(llvm::Value *mask) {
-@@ -1315,7 +1315,7 @@ llvm::Value *FunctionEmitContext::All(llvm::Value *mask) {
-     // We can actually call either one, since both are i32s as far as
-     // LLVM's type system is concerned...
-     llvm::Function *fmm = mm[0]->function;
--    return CallInst(fmm, NULL, mask, LLVMGetName(mask, "_all"));
-+    return CallInst(fmm, NULL, mask, llvm::Twine(mask->getName()) + "_all");
- }
- 
- llvm::Value *FunctionEmitContext::None(llvm::Value *mask) {
-@@ -1331,7 +1331,7 @@ llvm::Value *FunctionEmitContext::None(llvm::Value *mask) {
-     // We can actually call either one, since both are i32s as far as
-     // LLVM's type system is concerned...
-     llvm::Function *fmm = mm[0]->function;
--    return CallInst(fmm, NULL, mask, LLVMGetName(mask, "_none"));
-+    return CallInst(fmm, NULL, mask, llvm::Twine(mask->getName()) + "_none");
- }
- 
- llvm::Value *FunctionEmitContext::LaneMask(llvm::Value *v) {
-@@ -1349,7 +1349,7 @@ llvm::Value *FunctionEmitContext::LaneMask(llvm::Value *v) {
-     // We can actually call either one, since both are i32s as far as
-     // LLVM's type system is concerned...
-     llvm::Function *fmm = mm[0]->function;
--    return CallInst(fmm, NULL, v, LLVMGetName(v, "_movmsk"));
-+    return CallInst(fmm, NULL, v, llvm::Twine(v->getName()) + "_movmsk");
- }
- 
- llvm::Value *FunctionEmitContext::MasksAllEqual(llvm::Value *v1, llvm::Value *v2) {
-@@ -1364,11 +1364,12 @@ llvm::Value *FunctionEmitContext::MasksAllEqual(llvm::Value *v1, llvm::Value *v2
- #else
-     if (g->target->getArch() == Arch::wasm32) {
-         llvm::Function *fmm = m->module->getFunction("__wasm_cmp_msk_eq");
--        return CallInst(fmm, NULL, {v1, v2}, LLVMGetName("wasm_cmp_msk_eq", v1, v2));
-+        return CallInst(fmm, NULL, {v1, v2}, ((llvm::Twine("wasm_cmp_msk_eq_") + v1->getName()) + "_") + v2->getName());
-     }
-     llvm::Value *mm1 = LaneMask(v1);
-     llvm::Value *mm2 = LaneMask(v2);
--    return CmpInst(llvm::Instruction::ICmp, llvm::CmpInst::ICMP_EQ, mm1, mm2, LLVMGetName("equal", v1, v2));
-+    return CmpInst(llvm::Instruction::ICmp, llvm::CmpInst::ICMP_EQ, mm1, mm2,
-+                   ((llvm::Twine("equal_") + v1->getName()) + "_") + v2->getName());
- #endif
- }
- 
-@@ -1392,7 +1393,7 @@ llvm::Value *FunctionEmitContext::GetStringPtr(const std::string &str) {
-     return new llvm::BitCastInst(lstrPtr, LLVMTypes::VoidPointerType, "str_void_ptr", bblock);
- }
- 
--llvm::BasicBlock *FunctionEmitContext::CreateBasicBlock(const char *name, llvm::BasicBlock *insertAfter) {
-+llvm::BasicBlock *FunctionEmitContext::CreateBasicBlock(const llvm::Twine &name, llvm::BasicBlock *insertAfter) {
-     llvm::BasicBlock *newBB = llvm::BasicBlock::Create(*g->ctx, name, llvmFunction);
-     if (insertAfter)
-         newBB->moveAfter(insertAfter);
-@@ -1416,14 +1417,15 @@ llvm::Value *FunctionEmitContext::I1VecToBoolVec(llvm::Value *b) {
- 
-         for (unsigned int i = 0; i < at->getNumElements(); ++i) {
-             llvm::Value *elt = ExtractInst(b, i);
--            llvm::Value *sext = SwitchBoolSize(elt, LLVMTypes::BoolVectorStorageType, LLVMGetName(elt, "_to_boolvec"));
-+            llvm::Value *sext =
-+                SwitchBoolSize(elt, LLVMTypes::BoolVectorStorageType, llvm::Twine(elt->getName()) + "_to_boolvec");
-             ret = InsertInst(ret, sext, i);
-         }
-         return ret;
-     } else {
-         // For non-array types, convert to 'LLVMTypes::BoolVectorType' if
-         // necessary.
--        return SwitchBoolSize(b, LLVMTypes::BoolVectorType, LLVMGetName(b, "_to_boolvec"));
-+        return SwitchBoolSize(b, LLVMTypes::BoolVectorType, llvm::Twine(b->getName()) + "_to_boolvec");
-     }
- }
- 
-@@ -1563,7 +1565,7 @@ static int lArrayVectorWidth(llvm::Type *t) {
- }
- 
- llvm::Value *FunctionEmitContext::BinaryOperator(llvm::Instruction::BinaryOps inst, llvm::Value *v0, llvm::Value *v1,
--                                                 const char *name) {
-+                                                 const llvm::Twine &name) {
-     if (v0 == NULL || v1 == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1573,7 +1575,7 @@ llvm::Value *FunctionEmitContext::BinaryOperator(llvm::Instruction::BinaryOps in
-     llvm::Type *type = v0->getType();
-     int arraySize = lArrayVectorWidth(type);
-     if (arraySize == 0) {
--        llvm::Instruction *bop = llvm::BinaryOperator::Create(inst, v0, v1, name ? name : "", bblock);
-+        llvm::Instruction *bop = llvm::BinaryOperator::Create(inst, v0, v1, name, bblock);
-         AddDebugPos(bop);
-         return bop;
-     } else {
-@@ -1591,7 +1593,7 @@ llvm::Value *FunctionEmitContext::BinaryOperator(llvm::Instruction::BinaryOps in
-     }
- }
- 
--llvm::Value *FunctionEmitContext::NotOperator(llvm::Value *v, const char *name) {
-+llvm::Value *FunctionEmitContext::NotOperator(llvm::Value *v, const llvm::Twine &name) {
-     if (v == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1603,14 +1605,14 @@ llvm::Value *FunctionEmitContext::NotOperator(llvm::Value *v, const char *name)
-     llvm::Type *type = v->getType();
-     int arraySize = lArrayVectorWidth(type);
-     if (arraySize == 0) {
--        llvm::Instruction *binst = llvm::BinaryOperator::CreateNot(v, name ? name : "not", bblock);
-+        llvm::Instruction *binst = llvm::BinaryOperator::CreateNot(v, name.isTriviallyEmpty() ? "not" : name, bblock);
-         AddDebugPos(binst);
-         return binst;
-     } else {
-         llvm::Value *ret = llvm::UndefValue::get(type);
-         for (int i = 0; i < arraySize; ++i) {
-             llvm::Value *a = ExtractInst(v, i);
--            llvm::Value *op = llvm::BinaryOperator::CreateNot(a, name ? name : "not", bblock);
-+            llvm::Value *op = llvm::BinaryOperator::CreateNot(a, name.isTriviallyEmpty() ? "not" : name, bblock);
-             AddDebugPos(op);
-             ret = InsertInst(ret, op, i);
-         }
-@@ -1638,7 +1640,7 @@ static llvm::Type *lGetMatchingBoolVectorType(llvm::Type *type) {
- }
- 
- llvm::Value *FunctionEmitContext::CmpInst(llvm::Instruction::OtherOps inst, llvm::CmpInst::Predicate pred,
--                                          llvm::Value *v0, llvm::Value *v1, const char *name) {
-+                                          llvm::Value *v0, llvm::Value *v1, const llvm::Twine &name) {
-     if (v0 == NULL || v1 == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1648,7 +1650,8 @@ llvm::Value *FunctionEmitContext::CmpInst(llvm::Instruction::OtherOps inst, llvm
-     llvm::Type *type = v0->getType();
-     int arraySize = lArrayVectorWidth(type);
-     if (arraySize == 0) {
--        llvm::Instruction *ci = llvm::CmpInst::Create(inst, pred, v0, v1, name ? name : "cmp", bblock);
-+        llvm::Instruction *ci =
-+            llvm::CmpInst::Create(inst, pred, v0, v1, name.isTriviallyEmpty() ? "cmp" : name, bblock);
-         AddDebugPos(ci);
-         return ci;
-     } else {
-@@ -1657,14 +1660,14 @@ llvm::Value *FunctionEmitContext::CmpInst(llvm::Instruction::OtherOps inst, llvm
-         for (int i = 0; i < arraySize; ++i) {
-             llvm::Value *a = ExtractInst(v0, i);
-             llvm::Value *b = ExtractInst(v1, i);
--            llvm::Value *op = CmpInst(inst, pred, a, b, name);
-+            llvm::Value *op = CmpInst(inst, pred, a, b, name.isTriviallyEmpty() ? "cmp" : name);
-             ret = InsertInst(ret, op, i);
-         }
-         return ret;
-     }
- }
- 
--llvm::Value *FunctionEmitContext::SmearUniform(llvm::Value *value, const char *name) {
-+llvm::Value *FunctionEmitContext::SmearUniform(llvm::Value *value, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1704,21 +1707,19 @@ llvm::Value *FunctionEmitContext::SmearUniform(llvm::Value *value, const char *n
-     return ret;
- }
- 
--llvm::Value *FunctionEmitContext::BitCastInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Value *FunctionEmitContext::BitCastInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_bitcast");
--
--    llvm::Instruction *inst = new llvm::BitCastInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::BitCastInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_bitcast" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, const char *name) {
-+llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -1728,23 +1729,19 @@ llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, const char *n
-         // no-op for varying pointers; they're already vectors of ints
-         return value;
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_ptr2int");
-     llvm::Type *type = LLVMTypes::PointerIntType;
--    llvm::Instruction *inst = new llvm::PtrToIntInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::PtrToIntInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_ptr2int" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, llvm::Type *toType, const char *name) {
-+llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, llvm::Type *toType, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_ptr2int");
--
-     llvm::Type *fromType = value->getType();
-     if (llvm::isa<llvm::VectorType>(fromType)) {
-         // varying pointer
-@@ -1752,27 +1749,26 @@ llvm::Value *FunctionEmitContext::PtrToIntInst(llvm::Value *value, llvm::Type *t
-             // already the right type--done
-             return value;
-         else if (fromType->getScalarSizeInBits() > toType->getScalarSizeInBits())
--            return TruncInst(value, toType, name);
-+            return TruncInst(value, toType,
-+                             name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_ptr2int" : name);
-         else {
-             AssertPos(currentPos, fromType->getScalarSizeInBits() < toType->getScalarSizeInBits());
--            return ZExtInst(value, toType, name);
-+            return ZExtInst(value, toType, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_ptr2int" : name);
-         }
-     }
- 
--    llvm::Instruction *inst = new llvm::PtrToIntInst(value, toType, name, bblock);
-+    llvm::Instruction *inst = new llvm::PtrToIntInst(
-+        value, toType, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_ptr2int" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Value *FunctionEmitContext::IntToPtrInst(llvm::Value *value, llvm::Type *toType, const char *name) {
-+llvm::Value *FunctionEmitContext::IntToPtrInst(llvm::Value *value, llvm::Type *toType, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_int2ptr");
--
-     llvm::Type *fromType = value->getType();
-     if (llvm::isa<llvm::VectorType>(fromType)) {
-         // varying pointer
-@@ -1780,95 +1776,87 @@ llvm::Value *FunctionEmitContext::IntToPtrInst(llvm::Value *value, llvm::Type *t
-             // done
-             return value;
-         else if (fromType->getScalarSizeInBits() > toType->getScalarSizeInBits())
--            return TruncInst(value, toType, name);
-+            return TruncInst(value, toType,
-+                             name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_int2ptr" : name);
-         else {
-             AssertPos(currentPos, fromType->getScalarSizeInBits() < toType->getScalarSizeInBits());
--            return ZExtInst(value, toType, name);
-+            return ZExtInst(value, toType, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_int2ptr" : name);
-         }
-     }
- 
--    llvm::Instruction *inst = new llvm::IntToPtrInst(value, toType, name, bblock);
-+    llvm::Instruction *inst = new llvm::IntToPtrInst(
-+        value, toType, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_int2ptr" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Instruction *FunctionEmitContext::TruncInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Instruction *FunctionEmitContext::TruncInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_trunc");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = new llvm::TruncInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::TruncInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_trunc" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
- llvm::Instruction *FunctionEmitContext::CastInst(llvm::Instruction::CastOps op, llvm::Value *value, llvm::Type *type,
--                                                 const char *name) {
-+                                                 const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_cast");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = llvm::CastInst::Create(op, value, type, name, bblock);
-+    llvm::Instruction *inst = llvm::CastInst::Create(
-+        op, value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_cast" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Instruction *FunctionEmitContext::FPCastInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Instruction *FunctionEmitContext::FPCastInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_cast");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = llvm::CastInst::CreateFPCast(value, type, name, bblock);
-+    llvm::Instruction *inst = llvm::CastInst::CreateFPCast(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_cast" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Instruction *FunctionEmitContext::SExtInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Instruction *FunctionEmitContext::SExtInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_sext");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = new llvm::SExtInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::SExtInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_sext" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
- 
--llvm::Instruction *FunctionEmitContext::ZExtInst(llvm::Value *value, llvm::Type *type, const char *name) {
-+llvm::Instruction *FunctionEmitContext::ZExtInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name) {
-     if (value == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(value, "_zext");
--
-     // TODO: we should probably handle the array case as in
-     // e.g. BitCastInst(), but we don't currently need that functionality
--    llvm::Instruction *inst = new llvm::ZExtInst(value, type, name, bblock);
-+    llvm::Instruction *inst = new llvm::ZExtInst(
-+        value, type, name.isTriviallyEmpty() ? llvm::Twine(value->getName()) + "_zext" : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
-@@ -1913,14 +1901,15 @@ llvm::Value *FunctionEmitContext::applyVaryingGEP(llvm::Value *basePtr, llvm::Va
-         scale = SmearUniform(scale);
-         Assert(index != NULL);
-         // offset = index * scale
--        offset = BinaryOperator(llvm::Instruction::Mul, scale, index, LLVMGetName("mul", scale, index));
-+        offset = BinaryOperator(llvm::Instruction::Mul, scale, index,
-+                                ((llvm::Twine("mul_") + scale->getName()) + "_") + index->getName());
-     }
- 
-     // For 64-bit targets, if we've been doing our offset calculations in
-     // 32 bits, we still have to convert to a 64-bit value before we
-     // actually add the offset to the pointer.
-     if (g->target->is32Bit() == false && g->opt.force32BitAddressing == true)
--        offset = SExtInst(offset, LLVMTypes::Int64VectorType, LLVMGetName(offset, "_to_64"));
-+        offset = SExtInst(offset, LLVMTypes::Int64VectorType, llvm::Twine(offset->getName()) + "_to_64");
- 
-     // Smear out the pointer to be varying; either the base pointer or the
-     // index must be varying for this method to be called.
-@@ -1929,7 +1918,7 @@ llvm::Value *FunctionEmitContext::applyVaryingGEP(llvm::Value *basePtr, llvm::Va
-     llvm::Value *varyingPtr = baseIsUniform ? SmearUniform(basePtr) : basePtr;
- 
-     // newPtr = ptr + offset
--    return BinaryOperator(llvm::Instruction::Add, varyingPtr, offset, LLVMGetName(basePtr, "_offset"));
-+    return BinaryOperator(llvm::Instruction::Add, varyingPtr, offset, llvm::Twine(basePtr->getName()) + "_offset");
- }
- 
- void FunctionEmitContext::MatchIntegerTypes(llvm::Value **v0, llvm::Value **v1) {
-@@ -2006,13 +1995,13 @@ llvm::Value *FunctionEmitContext::MakeSlicePointer(llvm::Value *ptr, llvm::Value
-     llvm::StructType *st = llvm::StructType::get(*g->ctx, eltTypes);
- 
-     llvm::Value *ret = llvm::UndefValue::get(st);
--    ret = InsertInst(ret, ptr, 0, LLVMGetName(ret, "_slice_ptr"));
--    ret = InsertInst(ret, offset, 1, LLVMGetName(ret, "_slice_offset"));
-+    ret = InsertInst(ret, ptr, 0, llvm::Twine(ret->getName()) + "_slice_ptr");
-+    ret = InsertInst(ret, offset, 1, llvm::Twine(ret->getName()) + "_slice_offset");
-     return ret;
- }
- 
- llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::Value *index, const Type *ptrRefType,
--                                                    const char *name) {
-+                                                    const llvm::Twine &name) {
-     if (basePtr == NULL || index == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2065,8 +2054,8 @@ llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::
-         // uniform, so just emit the regular LLVM GEP instruction
-         llvm::Value *ind[1] = {index};
-         llvm::ArrayRef<llvm::Value *> arrayRef(&ind[0], &ind[1]);
--        llvm::Instruction *inst =
--            llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef, name ? name : "gep", bblock);
-+        llvm::Instruction *inst = llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef,
-+                                                                  name.isTriviallyEmpty() ? "gep" : name, bblock);
-         AddDebugPos(inst);
-         return inst;
-     } else
-@@ -2074,7 +2063,7 @@ llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::
- }
- 
- llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::Value *index0, llvm::Value *index1,
--                                                    const Type *ptrRefType, const char *name) {
-+                                                    const Type *ptrRefType, const llvm::Twine &name) {
-     if (basePtr == NULL || index0 == NULL || index1 == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2114,8 +2103,8 @@ llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::
-         // uniform, so just emit the regular LLVM GEP instruction
-         llvm::Value *indices[2] = {index0, index1};
-         llvm::ArrayRef<llvm::Value *> arrayRef(&indices[0], &indices[2]);
--        llvm::Instruction *inst =
--            llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef, name ? name : "gep", bblock);
-+        llvm::Instruction *inst = llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef,
-+                                                                  name.isTriviallyEmpty() ? "gep" : name, bblock);
-         AddDebugPos(inst);
-         return inst;
-     } else {
-@@ -2138,7 +2127,7 @@ llvm::Value *FunctionEmitContext::GetElementPtrInst(llvm::Value *basePtr, llvm::
- }
- 
- llvm::Value *FunctionEmitContext::AddElementOffset(llvm::Value *fullBasePtr, int elementNum, const Type *ptrRefType,
--                                                   const char *name, const PointerType **resultPtrType) {
-+                                                   const llvm::Twine &name, const PointerType **resultPtrType) {
-     if (resultPtrType != NULL)
-         AssertPos(currentPos, ptrRefType != NULL);
- 
-@@ -2195,8 +2184,8 @@ llvm::Value *FunctionEmitContext::AddElementOffset(llvm::Value *fullBasePtr, int
-         // If the pointer is uniform, we can use the regular LLVM GEP.
-         llvm::Value *offsets[2] = {LLVMInt32(0), LLVMInt32(elementNum)};
-         llvm::ArrayRef<llvm::Value *> arrayRef(&offsets[0], &offsets[2]);
--        resultPtr =
--            llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef, name ? name : "struct_offset", bblock);
-+        resultPtr = llvm::GetElementPtrInst::Create(PTYPE(basePtr), basePtr, arrayRef,
-+                                                    name.isTriviallyEmpty() ? "struct_offset" : name, bblock);
-     } else {
-         // Otherwise do the math to find the offset and add it to the given
-         // varying pointers
-@@ -2237,7 +2226,7 @@ llvm::Value *FunctionEmitContext::AddElementOffset(llvm::Value *fullBasePtr, int
-         return resultPtr;
- }
- 
--llvm::Value *FunctionEmitContext::SwitchBoolSize(llvm::Value *value, llvm::Type *toType, const char *name) {
-+llvm::Value *FunctionEmitContext::SwitchBoolSize(llvm::Value *value, llvm::Type *toType, const llvm::Twine &name) {
-     if ((value == NULL) || (toType == NULL)) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2248,20 +2237,18 @@ llvm::Value *FunctionEmitContext::SwitchBoolSize(llvm::Value *value, llvm::Type
-     llvm::Value *newBool = value;
-     if (g->target->getDataLayout()->getTypeSizeInBits(fromType) >
-         g->target->getDataLayout()->getTypeSizeInBits(toType)) {
--        if (name == NULL)
--            name = LLVMGetName(value, "_switchBool");
--        newBool = TruncInst(value, toType, name);
-+        newBool =
-+            TruncInst(value, toType, name.isTriviallyEmpty() ? (llvm::Twine(value->getName()) + "_switchBool") : name);
-     } else if (g->target->getDataLayout()->getTypeSizeInBits(fromType) <
-                g->target->getDataLayout()->getTypeSizeInBits(toType)) {
--        if (name == NULL)
--            name = LLVMGetName(value, "_switchBool");
--        newBool = SExtInst(value, toType, name);
-+        newBool =
-+            SExtInst(value, toType, name.isTriviallyEmpty() ? (llvm::Twine(value->getName()) + "_switchBool") : name);
-     }
- 
-     return newBool;
- }
- 
--llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, const char *name) {
-+llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, const llvm::Twine &name) {
-     if (ptr == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2270,13 +2257,13 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, c
-     llvm::PointerType *pt = llvm::dyn_cast<llvm::PointerType>(ptr->getType());
-     AssertPos(currentPos, pt != NULL);
- 
--    if (name == NULL)
--        name = LLVMGetName(ptr, "_load");
--
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--    llvm::LoadInst *inst = new llvm::LoadInst(pt->getPointerElementType(), ptr, name, bblock);
-+    llvm::LoadInst *inst =
-+        new llvm::LoadInst(pt->getPointerElementType(), ptr,
-+                           name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name, bblock);
- #else
--    llvm::LoadInst *inst = new llvm::LoadInst(ptr, name, bblock);
-+    llvm::LoadInst *inst =
-+        new llvm::LoadInst(ptr, name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name, bblock);
- #endif
- 
-     if (g->opt.forceAlignedMemory && llvm::dyn_cast<llvm::VectorType>(pt->getElementType())) {
-@@ -2307,8 +2294,8 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, const Type *type, c
- static llvm::Value *lFinalSliceOffset(FunctionEmitContext *ctx, llvm::Value *ptr, const PointerType **ptrType) {
-     Assert(CastType<PointerType>(*ptrType) != NULL);
- 
--    llvm::Value *slicePtr = ctx->ExtractInst(ptr, 0, LLVMGetName(ptr, "_ptr"));
--    llvm::Value *sliceOffset = ctx->ExtractInst(ptr, 1, LLVMGetName(ptr, "_offset"));
-+    llvm::Value *slicePtr = ctx->ExtractInst(ptr, 0, llvm::Twine(ptr->getName()) + "_ptr");
-+    llvm::Value *sliceOffset = ctx->ExtractInst(ptr, 1, llvm::Twine(ptr->getName()) + "_offset");
- 
-     // slicePtr should be a pointer to an soa-width wide array of the
-     // final atomic/enum/pointer type
-@@ -2327,14 +2314,14 @@ static llvm::Value *lFinalSliceOffset(FunctionEmitContext *ctx, llvm::Value *ptr
-         slicePtr = ctx->BitCastInst(slicePtr, (*ptrType)->LLVMType(g->ctx));
- 
-     // And finally index based on the slice offset
--    return ctx->GetElementPtrInst(slicePtr, sliceOffset, *ptrType, LLVMGetName(slicePtr, "_final_gep"));
-+    return ctx->GetElementPtrInst(slicePtr, sliceOffset, *ptrType, llvm::Twine(slicePtr->getName()) + "_final_gep");
- }
- 
- /** Utility routine that loads from a uniform pointer to soa<> data,
-     returning a regular uniform (non-SOA result).
-  */
- llvm::Value *FunctionEmitContext::loadUniformFromSOA(llvm::Value *ptr, llvm::Value *mask, const PointerType *ptrType,
--                                                     const char *name) {
-+                                                     const llvm::Twine &name) {
-     const Type *unifType = ptrType->GetBaseType()->GetAsUniformType();
- 
-     const CollectionType *ct = CastType<CollectionType>(ptrType->GetBaseType());
-@@ -2363,7 +2350,7 @@ llvm::Value *FunctionEmitContext::loadUniformFromSOA(llvm::Value *ptr, llvm::Val
- }
- 
- llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask, const Type *ptrRefType,
--                                           const char *name, bool one_elem) {
-+                                           const llvm::Twine &name, bool one_elem) {
-     if (ptr == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2371,9 +2358,6 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
- 
-     AssertPos(currentPos, ptrRefType != NULL && mask != NULL);
- 
--    if (name == NULL)
--        name = LLVMGetName(ptr, "_load");
--
-     const PointerType *ptrType;
-     const Type *elType;
-     if (CastType<ReferenceType>(ptrRefType) != NULL) {
-@@ -2393,7 +2377,8 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
- 
-     if (ptrType->IsUniformType()) {
-         if (ptrType->IsSlice()) {
--            return loadUniformFromSOA(ptr, mask, ptrType, name);
-+            return loadUniformFromSOA(ptr, mask, ptrType,
-+                                      name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name);
-         } else {
-             // FIXME: same issue as above load inst regarding alignment...
-             //
-@@ -2405,11 +2390,15 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
-             const AtomicType *atomicType = CastType<AtomicType>(ptrType->GetBaseType());
- 
- #if ISPC_LLVM_VERSION <= ISPC_LLVM_10_0
--            llvm::LoadInst *inst = new llvm::LoadInst(ptr, name, false /* not volatile */, bblock);
-+            llvm::LoadInst *inst =
-+                new llvm::LoadInst(ptr, name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name,
-+                                   false /* not volatile */, bblock);
- #else // LLVM 11.0+
-             llvm::PointerType *ptr_type = llvm::dyn_cast<llvm::PointerType>(ptr->getType());
-             llvm::LoadInst *inst =
--                new llvm::LoadInst(ptr_type->getPointerElementType(), ptr, name, false /* not volatile */, bblock);
-+                new llvm::LoadInst(ptr_type->getPointerElementType(), ptr,
-+                                   name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name,
-+                                   false /* not volatile */, bblock);
- #endif
- 
-             if (atomicType != NULL && atomicType->IsVaryingType()) {
-@@ -2433,7 +2422,8 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
-     } else {
-         // Otherwise we should have a varying ptr and it's time for a
-         // gather.
--        llvm::Value *gather_result = gather(ptr, ptrType, GetFullMask(), name);
-+        llvm::Value *gather_result = gather(ptr, ptrType, GetFullMask(),
-+                                            name.isTriviallyEmpty() ? (llvm::Twine(ptr->getName()) + "_load") : name);
-         if (!one_elem)
-             return gather_result;
- 
-@@ -2453,19 +2443,19 @@ llvm::Value *FunctionEmitContext::LoadInst(llvm::Value *ptr, llvm::Value *mask,
-         // We can actually call either one, since both are i32s as far as
-         // LLVM's type system is concerned...
-         llvm::Function *fmm = mm[0]->function;
--        llvm::Value *int_mask = CallInst(fmm, NULL, mask, LLVMGetName(mask, "_movmsk"));
-+        llvm::Value *int_mask = CallInst(fmm, NULL, mask, llvm::Twine(mask->getName()) + "_movmsk");
-         std::vector<Symbol *> lz;
-         m->symbolTable->LookupFunction("__count_trailing_zeros_i64", &lz);
-         llvm::Function *flz = lz[0]->function;
--        llvm::Value *elem_idx = CallInst(flz, NULL, int_mask, LLVMGetName(mask, "_clz"));
--        llvm::Value *elem = llvm::ExtractElementInst::Create(gather_result, elem_idx,
--                                                             LLVMGetName(gather_result, "_umasked_elem"), bblock);
-+        llvm::Value *elem_idx = CallInst(flz, NULL, int_mask, llvm::Twine(mask->getName()) + "_clz");
-+        llvm::Value *elem = llvm::ExtractElementInst::Create(
-+            gather_result, elem_idx, llvm::Twine(gather_result->getName()) + "_umasked_elem", bblock);
-         return elem;
-     }
- }
- 
- llvm::Value *FunctionEmitContext::gather(llvm::Value *ptr, const PointerType *ptrType, llvm::Value *mask,
--                                         const char *name) {
-+                                         const llvm::Twine &name) {
-     // We should have a varying pointer if we get here...
-     AssertPos(currentPos, ptrType->IsVaryingType());
- 
-@@ -2602,7 +2592,8 @@ void FunctionEmitContext::addGSMetadata(llvm::Value *v, SourcePos pos) {
-     inst->setMetadata("last_column", md);
- }
- 
--llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const char *name, int align, bool atEntryBlock) {
-+llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const llvm::Twine &name, int align,
-+                                             bool atEntryBlock) {
-     if (llvmType == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -2615,12 +2606,12 @@ llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const char *n
-         llvm::Instruction *retInst = allocaBlock->getTerminator();
-         AssertPos(currentPos, retInst);
-         unsigned AS = llvmFunction->getParent()->getDataLayout().getAllocaAddrSpace();
--        inst = new llvm::AllocaInst(llvmType, AS, name ? name : "", retInst);
-+        inst = new llvm::AllocaInst(llvmType, AS, name, retInst);
-     } else {
-         // Unless the caller overrode the default and wants it in the
-         // current basic block
-         unsigned AS = llvmFunction->getParent()->getDataLayout().getAllocaAddrSpace();
--        inst = new llvm::AllocaInst(llvmType, AS, name ? name : "", bblock);
-+        inst = new llvm::AllocaInst(llvmType, AS, name, bblock);
-     }
- 
-     // If no alignment was specified but we have an array of a uniform
-@@ -2639,7 +2630,8 @@ llvm::Value *FunctionEmitContext::AllocaInst(llvm::Type *llvmType, const char *n
-     return inst;
- }
- 
--llvm::Value *FunctionEmitContext::AllocaInst(const Type *ptrType, const char *name, int align, bool atEntryBlock) {
-+llvm::Value *FunctionEmitContext::AllocaInst(const Type *ptrType, const llvm::Twine &name, int align,
-+                                             bool atEntryBlock) {
-     if (ptrType == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -3075,66 +3067,59 @@ llvm::Instruction *FunctionEmitContext::BranchInst(llvm::BasicBlock *trueBlock,
-     return b;
- }
- 
--llvm::Value *FunctionEmitContext::ExtractInst(llvm::Value *v, int elt, const char *name) {
-+llvm::Value *FunctionEmitContext::ExtractInst(llvm::Value *v, int elt, const llvm::Twine &name) {
-     if (v == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL) {
--        char buf[32];
--        snprintf(buf, sizeof(buf), "_extract_%d", elt);
--        name = LLVMGetName(v, buf);
--    }
-     llvm::Instruction *ei = NULL;
-     if (llvm::isa<llvm::VectorType>(v->getType()))
--        ei = llvm::ExtractElementInst::Create(v, LLVMInt32(elt), name, bblock);
-+        ei = llvm::ExtractElementInst::Create(
-+            v, LLVMInt32(elt),
-+            name.isTriviallyEmpty() ? ((llvm::Twine(v->getName()) + "_extract_") + llvm::Twine(elt)) : name, bblock);
-     else
--        ei = llvm::ExtractValueInst::Create(v, elt, name, bblock);
-+        ei = llvm::ExtractValueInst::Create(
-+            v, elt, name.isTriviallyEmpty() ? ((llvm::Twine(v->getName()) + "_extract_") + llvm::Twine(elt)) : name,
-+            bblock);
-     AddDebugPos(ei);
-     return ei;
- }
- 
--llvm::Value *FunctionEmitContext::InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt, const char *name) {
-+llvm::Value *FunctionEmitContext::InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt, const llvm::Twine &name) {
-     if (v == NULL || eltVal == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL) {
--        char buf[32];
--        snprintf(buf, sizeof(buf), "_insert_%d", elt);
--        name = LLVMGetName(v, buf);
--    }
--
-     llvm::Instruction *ii = NULL;
-     if (llvm::isa<llvm::VectorType>(v->getType()))
--        ii = llvm::InsertElementInst::Create(v, eltVal, LLVMInt32(elt), name, bblock);
-+        ii = llvm::InsertElementInst::Create(
-+            v, eltVal, LLVMInt32(elt),
-+            name.isTriviallyEmpty() ? ((llvm::Twine(v->getName()) + "_insert_") + llvm::Twine(elt)) : name, bblock);
-     else
--        ii = llvm::InsertValueInst::Create(v, eltVal, elt, name, bblock);
-+        ii = llvm::InsertValueInst::Create(
-+            v, eltVal, elt,
-+            name.isTriviallyEmpty() ? ((llvm::Twine(v->getName()) + "_insert_") + llvm::Twine(elt)) : name, bblock);
-     AddDebugPos(ii);
-     return ii;
- }
- 
--llvm::Value *FunctionEmitContext::ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask, const char *name) {
-+llvm::Value *FunctionEmitContext::ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask,
-+                                              const llvm::Twine &name) {
-     if (v1 == NULL || v2 == NULL || mask == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL) {
--        char buf[32];
--        snprintf(buf, sizeof(buf), "_shuffle");
--        name = LLVMGetName(v1, buf);
--    }
--
--    llvm::Instruction *ii = new llvm::ShuffleVectorInst(v1, v2, mask, name, bblock);
-+    llvm::Instruction *ii = new llvm::ShuffleVectorInst(
-+        v1, v2, mask, name.isTriviallyEmpty() ? (llvm::Twine(v1->getName()) + "_shuffle") : name, bblock);
- 
-     AddDebugPos(ii);
-     return ii;
- }
- 
--llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vecType, const char *name) {
-+llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vecType, const llvm::Twine &name) {
-     if (v == NULL || vecType == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -3148,12 +3133,6 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
-     Assert(ty && ty->getVectorElementType() == v->getType());
- #endif
- 
--    if (name == NULL) {
--        char buf[32];
--        snprintf(buf, sizeof(buf), "_broadcast");
--        name = LLVMGetName(v, buf);
--    }
--
-     // Generate the following sequence:
-     //   %name_init.i = insertelement <4 x i32> undef, i32 %val, i32 0
-     //   %name.i = shufflevector <4 x i32> %name_init.i, <4 x i32> undef,
-@@ -3163,7 +3142,7 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
-     llvm::Value *undef2 = llvm::UndefValue::get(vecType);
- 
-     // InsertElement
--    llvm::Twine tw = llvm::Twine(name) + llvm::Twine("_init");
-+    llvm::Twine tw = name.isTriviallyEmpty() ? (llvm::Twine(v->getName()) + "_broadcast") : name + llvm::Twine("_init");
-     llvm::Value *insert = InsertInst(undef1, v, 0, tw.str().c_str());
- 
-     // ShuffleVector
-@@ -3179,28 +3158,27 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
-         llvm::ConstantVector::getSplat(llvm::ElementCount::get(static_cast<unsigned int>(ty->getNumElements()), false),
-                                        llvm::Constant::getNullValue(llvm::Type::getInt32Ty(*g->ctx)));
- #endif
--    llvm::Value *ret = ShuffleInst(insert, undef2, zeroVec, name);
-+    llvm::Value *ret = ShuffleInst(insert, undef2, zeroVec,
-+                                   name.isTriviallyEmpty() ? (llvm::Twine(v->getName()) + "_broadcast") : name);
- 
-     return ret;
- }
- 
--llvm::PHINode *FunctionEmitContext::PhiNode(llvm::Type *type, int count, const char *name) {
--    llvm::PHINode *pn = llvm::PHINode::Create(type, count, name ? name : "phi", bblock);
-+llvm::PHINode *FunctionEmitContext::PhiNode(llvm::Type *type, int count, const llvm::Twine &name) {
-+    llvm::PHINode *pn = llvm::PHINode::Create(type, count, name.isTriviallyEmpty() ? "phi" : name, bblock);
-     AddDebugPos(pn);
-     return pn;
- }
- 
- llvm::Instruction *FunctionEmitContext::SelectInst(llvm::Value *test, llvm::Value *val0, llvm::Value *val1,
--                                                   const char *name) {
-+                                                   const llvm::Twine &name) {
-     if (test == NULL || val0 == NULL || val1 == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-     }
- 
--    if (name == NULL)
--        name = LLVMGetName(test, "_select");
--
--    llvm::Instruction *inst = llvm::SelectInst::Create(test, val0, val1, name, bblock);
-+    llvm::Instruction *inst = llvm::SelectInst::Create(
-+        test, val0, val1, name.isTriviallyEmpty() ? (llvm::Twine(test->getName()) + "_select") : name, bblock);
-     AddDebugPos(inst);
-     return inst;
- }
-@@ -3226,7 +3204,7 @@ static unsigned int lCalleeArgCount(llvm::Value *callee, const FunctionType *fun
- }
- 
- llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType *funcType,
--                                           const std::vector<llvm::Value *> &args, const char *name) {
-+                                           const std::vector<llvm::Value *> &args, const llvm::Twine &name) {
-     if (func == NULL) {
-         AssertPos(currentPos, m->errorCount > 0);
-         return NULL;
-@@ -3258,9 +3236,9 @@ llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-         llvm::PointerType *func_ptr_type = llvm::dyn_cast<llvm::PointerType>(func->getType());
-         llvm::FunctionType *func_type = llvm::dyn_cast<llvm::FunctionType>(func_ptr_type->getPointerElementType());
--        llvm::CallInst *callinst = llvm::CallInst::Create(func_type, func, argVals, name ? name : "", bblock);
-+        llvm::CallInst *callinst = llvm::CallInst::Create(func_type, func, argVals, name, bblock);
- #else
--        llvm::CallInst *callinst = llvm::CallInst::Create(func, argVals, name ? name : "", bblock);
-+        llvm::CallInst *callinst = llvm::CallInst::Create(func, argVals, name, bblock);
- #endif
- 
-         // We could be dealing with a function pointer in which case this will not be a 'llvm::Function'.
-@@ -3464,14 +3442,14 @@ llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType
- }
- 
- llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg,
--                                           const char *name) {
-+                                           const llvm::Twine &name) {
-     std::vector<llvm::Value *> args;
-     args.push_back(arg);
-     return CallInst(func, funcType, args, name);
- }
- 
- llvm::Value *FunctionEmitContext::CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg0,
--                                           llvm::Value *arg1, const char *name) {
-+                                           llvm::Value *arg1, const llvm::Twine &name) {
-     std::vector<llvm::Value *> args;
-     args.push_back(arg0);
-     args.push_back(arg1);
-diff --git a/src/ctx.h b/src/ctx.h
-index 6e5ad74ba..48b3bb826 100644
---- a/src/ctx.h
-+++ b/src/ctx.h
-@@ -302,7 +302,7 @@ class FunctionEmitContext {
-     llvm::Value *GetStringPtr(const std::string &str);
- 
-     /** Create a new basic block with given name */
--    llvm::BasicBlock *CreateBasicBlock(const char *name, llvm::BasicBlock *insertAfter = NULL);
-+    llvm::BasicBlock *CreateBasicBlock(const llvm::Twine &name, llvm::BasicBlock *insertAfter = NULL);
- 
-     /** Given a vector with element type i1, return a vector of type
-         LLVMTypes::BoolVectorType.  This method handles the conversion for
-@@ -380,33 +380,33 @@ class FunctionEmitContext {
-         this also handles applying the given operation to the vector
-         elements. */
-     llvm::Value *BinaryOperator(llvm::Instruction::BinaryOps inst, llvm::Value *v0, llvm::Value *v1,
--                                const char *name = NULL);
-+                                const llvm::Twine &name = "");
- 
-     /** Emit the "not" operator.  Like BinaryOperator(), this also handles
-         a VectorType-based operand. */
--    llvm::Value *NotOperator(llvm::Value *v, const char *name = NULL);
-+    llvm::Value *NotOperator(llvm::Value *v, const llvm::Twine &name = "");
- 
-     /** Emit a comparison instruction.  If the operands are VectorTypes,
-         then a value for the corresponding boolean VectorType is
-         returned. */
-     llvm::Value *CmpInst(llvm::Instruction::OtherOps inst, llvm::CmpInst::Predicate pred, llvm::Value *v0,
--                         llvm::Value *v1, const char *name = NULL);
-+                         llvm::Value *v1, const llvm::Twine &name = "");
- 
-     /** Given a scalar value, return a vector of the same type (or an
-         array, for pointer types). */
--    llvm::Value *SmearUniform(llvm::Value *value, const char *name = NULL);
-+    llvm::Value *SmearUniform(llvm::Value *value, const llvm::Twine &name = "");
- 
--    llvm::Value *BitCastInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
--    llvm::Value *PtrToIntInst(llvm::Value *value, const char *name = NULL);
--    llvm::Value *PtrToIntInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
--    llvm::Value *IntToPtrInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
-+    llvm::Value *BitCastInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-+    llvm::Value *PtrToIntInst(llvm::Value *value, const llvm::Twine &name = "");
-+    llvm::Value *PtrToIntInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-+    llvm::Value *IntToPtrInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
- 
--    llvm::Instruction *TruncInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
-+    llvm::Instruction *TruncInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-     llvm::Instruction *CastInst(llvm::Instruction::CastOps op, llvm::Value *value, llvm::Type *type,
--                                const char *name = NULL);
--    llvm::Instruction *FPCastInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
--    llvm::Instruction *SExtInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
--    llvm::Instruction *ZExtInst(llvm::Value *value, llvm::Type *type, const char *name = NULL);
-+                                const llvm::Twine &name = "");
-+    llvm::Instruction *FPCastInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-+    llvm::Instruction *SExtInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
-+    llvm::Instruction *ZExtInst(llvm::Value *value, llvm::Type *type, const llvm::Twine &name = "");
- 
-     /** Given two integer-typed values (but possibly one vector and the
-         other not, and or of possibly-different bit-widths), update their
-@@ -426,9 +426,9 @@ class FunctionEmitContext {
-         pointers.  The underlying type of the base pointer must be provided
-         via the ptrType parameter */
-     llvm::Value *GetElementPtrInst(llvm::Value *basePtr, llvm::Value *index, const Type *ptrType,
--                                   const char *name = NULL);
-+                                   const llvm::Twine &name = "");
-     llvm::Value *GetElementPtrInst(llvm::Value *basePtr, llvm::Value *index0, llvm::Value *index1, const Type *ptrType,
--                                   const char *name = NULL);
-+                                   const llvm::Twine &name = "");
- 
-     /** This method returns a new pointer that represents offsetting the
-         given base pointer to point at the given element number of the
-@@ -436,26 +436,26 @@ class FunctionEmitContext {
-         pointer must be a pointer to a structure type.  The ptrType gives
-         the type of the pointer, though it may be NULL if the base pointer
-         is uniform. */
--    llvm::Value *AddElementOffset(llvm::Value *basePtr, int elementNum, const Type *ptrType, const char *name = NULL,
--                                  const PointerType **resultPtrType = NULL);
-+    llvm::Value *AddElementOffset(llvm::Value *basePtr, int elementNum, const Type *ptrType,
-+                                  const llvm::Twine &name = "", const PointerType **resultPtrType = NULL);
- 
-     /** Bool is stored as i8 and <WIDTH x i8> but represented in IR as i1 and
-      * <WIDTH x MASK>. This is a helper function to match bool size at storage
-      * interface. */
--    llvm::Value *SwitchBoolSize(llvm::Value *value, llvm::Type *toType, const char *name = NULL);
-+    llvm::Value *SwitchBoolSize(llvm::Value *value, llvm::Type *toType, const llvm::Twine &name = "");
-     /** Load from the memory location(s) given by lvalue, using the given
-         mask.  The lvalue may be varying, in which case this corresponds to
-         a gather from the multiple memory locations given by the array of
-         pointer values given by the lvalue.  If the lvalue is not varying,
-         then both the mask pointer and the type pointer may be NULL. */
--    llvm::Value *LoadInst(llvm::Value *ptr, llvm::Value *mask, const Type *ptrType, const char *name = NULL,
-+    llvm::Value *LoadInst(llvm::Value *ptr, llvm::Value *mask, const Type *ptrType, const llvm::Twine &name = "",
-                           bool one_elem = false);
- 
-     /* Load from memory location(s) given.
-      * 'type' needs to be provided when storage type is different from IR type. For example,
-      * 'unform bool' is 'i1' in IR but stored as 'i8'.
-      * Otherwise leave this as NULL. */
--    llvm::Value *LoadInst(llvm::Value *ptr, const Type *type = NULL, const char *name = NULL);
-+    llvm::Value *LoadInst(llvm::Value *ptr, const Type *type = NULL, const llvm::Twine &name = "");
- 
-     /** Emits an alloca instruction to allocate stack storage for the given
-         type.  If a non-zero alignment is specified, the object is also
-@@ -463,7 +463,8 @@ class FunctionEmitContext {
-         instruction is added at the start of the function in the entry
-         basic block; if it should be added to the current basic block, then
-         the atEntryBlock parameter should be false. */
--    llvm::Value *AllocaInst(llvm::Type *llvmType, const char *name = NULL, int align = 0, bool atEntryBlock = true);
-+    llvm::Value *AllocaInst(llvm::Type *llvmType, const llvm::Twine &name = "", int align = 0,
-+                            bool atEntryBlock = true);
- 
-     /** Emits an alloca instruction to allocate stack storage for the given
-         type.  If a non-zero alignment is specified, the object is also
-@@ -474,7 +475,7 @@ class FunctionEmitContext {
-         This implementation is preferred when possible. It is needed when
-         storage type is different from IR type. For example,
-         'unform bool' is 'i1' in IR but stored as 'i8'. */
--    llvm::Value *AllocaInst(const Type *ptrType, const char *name = NULL, int align = 0, bool atEntryBlock = true);
-+    llvm::Value *AllocaInst(const Type *ptrType, const llvm::Twine &name = "", int align = 0, bool atEntryBlock = true);
- 
-     /** Standard store instruction; for this variant, the lvalue must be a
-         single pointer, not a varying lvalue.
-@@ -502,39 +503,41 @@ class FunctionEmitContext {
-     /** This convenience method maps to an llvm::ExtractElementInst if the
-         given value is a llvm::VectorType, and to an llvm::ExtractValueInst
-         otherwise. */
--    llvm::Value *ExtractInst(llvm::Value *v, int elt, const char *name = NULL);
-+    llvm::Value *ExtractInst(llvm::Value *v, int elt, const llvm::Twine &name = "");
- 
-     /** This convenience method maps to an llvm::InsertElementInst if the
-         given value is a llvm::VectorType, and to an llvm::InsertValueInst
-         otherwise. */
--    llvm::Value *InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt, const char *name = NULL);
-+    llvm::Value *InsertInst(llvm::Value *v, llvm::Value *eltVal, int elt, const llvm::Twine &name = "");
- 
-     /** This convenience method maps to an llvm::ShuffleVectorInst. */
--    llvm::Value *ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask, const char *name = NULL);
-+    llvm::Value *ShuffleInst(llvm::Value *v1, llvm::Value *v2, llvm::Value *mask, const llvm::Twine &name = "");
- 
-     /** This convenience method to generate broadcast pattern. It takes a value
-         and a vector type. Type of the value must match element type of the
-         vector. */
--    llvm::Value *BroadcastValue(llvm::Value *v, llvm::Type *vecType, const char *name = NULL);
-+    llvm::Value *BroadcastValue(llvm::Value *v, llvm::Type *vecType, const llvm::Twine &name = "");
- 
--    llvm::PHINode *PhiNode(llvm::Type *type, int count, const char *name = NULL);
--    llvm::Instruction *SelectInst(llvm::Value *test, llvm::Value *val0, llvm::Value *val1, const char *name = NULL);
-+    llvm::PHINode *PhiNode(llvm::Type *type, int count, const llvm::Twine &name = "");
-+    llvm::Instruction *SelectInst(llvm::Value *test, llvm::Value *val0, llvm::Value *val1,
-+                                  const llvm::Twine &name = "");
- 
-     /** Emits IR to do a function call with the given arguments.  If the
-         function type is a varying function pointer type, its full type
-         must be provided in funcType.  funcType can be NULL if func is a
-         uniform function pointer. */
-     llvm::Value *CallInst(llvm::Value *func, const FunctionType *funcType, const std::vector<llvm::Value *> &args,
--                          const char *name = NULL);
-+                          const llvm::Twine &name = "");
- 
-     /** This is a convenience method that issues a call instruction to a
-         function that takes just a single argument. */
--    llvm::Value *CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg, const char *name = NULL);
-+    llvm::Value *CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg,
-+                          const llvm::Twine &name = "");
- 
-     /** This is a convenience method that issues a call instruction to a
-         function that takes two arguments. */
-     llvm::Value *CallInst(llvm::Value *func, const FunctionType *funcType, llvm::Value *arg0, llvm::Value *arg1,
--                          const char *name = NULL);
-+                          const llvm::Twine &name = "");
- 
-     /** Launch an asynchronous task to run the given function, passing it
-         he given argument values. */
-@@ -756,9 +759,10 @@ class FunctionEmitContext {
-     void maskedStore(llvm::Value *value, llvm::Value *ptr, const Type *ptrType, llvm::Value *mask);
-     void storeUniformToSOA(llvm::Value *value, llvm::Value *ptr, llvm::Value *mask, const Type *valueType,
-                            const PointerType *ptrType);
--    llvm::Value *loadUniformFromSOA(llvm::Value *ptr, llvm::Value *mask, const PointerType *ptrType, const char *name);
-+    llvm::Value *loadUniformFromSOA(llvm::Value *ptr, llvm::Value *mask, const PointerType *ptrType,
-+                                    const llvm::Twine &name = "");
- 
--    llvm::Value *gather(llvm::Value *ptr, const PointerType *ptrType, llvm::Value *mask, const char *name);
-+    llvm::Value *gather(llvm::Value *ptr, const PointerType *ptrType, llvm::Value *mask, const llvm::Twine &name = "");
- 
-     llvm::Value *addVaryingOffsetsIfNeeded(llvm::Value *ptr, const Type *ptrType);
- };
-diff --git a/src/expr.cpp b/src/expr.cpp
-index 80cc3020a..6d38d1889 100644
---- a/src/expr.cpp
-+++ b/src/expr.cpp
-@@ -1021,11 +1021,11 @@ static llvm::Value *lEmitNegate(Expr *arg, SourcePos pos, FunctionEmitContext *c
-     ctx->SetDebugPos(pos);
-     if (type->IsFloatType()) {
-         llvm::Value *zero = llvm::ConstantFP::getZeroValueForNegation(type->LLVMType(g->ctx));
--        return ctx->BinaryOperator(llvm::Instruction::FSub, zero, argVal, LLVMGetName(argVal, "_negate"));
-+        return ctx->BinaryOperator(llvm::Instruction::FSub, zero, argVal, llvm::Twine(argVal->getName()) + "_negate");
-     } else {
-         llvm::Value *zero = lLLVMConstantValue(type, g->ctx, 0.);
-         AssertPos(pos, type->IsIntType());
--        return ctx->BinaryOperator(llvm::Instruction::Sub, zero, argVal, LLVMGetName(argVal, "_negate"));
-+        return ctx->BinaryOperator(llvm::Instruction::Sub, zero, argVal, llvm::Twine(argVal->getName()) + "_negate");
-     }
- }
- 
-@@ -1047,11 +1047,11 @@ llvm::Value *UnaryExpr::GetValue(FunctionEmitContext *ctx) const {
-         return lEmitNegate(expr, pos, ctx);
-     case LogicalNot: {
-         llvm::Value *argVal = expr->GetValue(ctx);
--        return ctx->NotOperator(argVal, LLVMGetName(argVal, "_logicalnot"));
-+        return ctx->NotOperator(argVal, llvm::Twine(argVal->getName()) + "_logicalnot");
-     }
-     case BitNot: {
-         llvm::Value *argVal = expr->GetValue(ctx);
--        return ctx->NotOperator(argVal, LLVMGetName(argVal, "_bitnot"));
-+        return ctx->NotOperator(argVal, llvm::Twine(argVal->getName()) + "_bitnot");
-     }
-     default:
-         FATAL("logic error");
-@@ -1518,7 +1518,8 @@ static llvm::Value *lEmitBinaryArith(BinaryExpr::Op op, llvm::Value *value0, llv
-             return NULL;
-         }
- 
--        return ctx->BinaryOperator(inst, value0, value1, LLVMGetName(opName, value0, value1));
-+        return ctx->BinaryOperator(inst, value0, value1,
-+                                   (((llvm::Twine(opName) + "_") + value0->getName()) + "_") + value1->getName());
-     }
- }
- 
-@@ -1563,7 +1564,7 @@ static llvm::Value *lEmitBinaryCmp(BinaryExpr::Op op, llvm::Value *e0Val, llvm::
-     }
- 
-     llvm::Value *cmp = ctx->CmpInst(isFloatOp ? llvm::Instruction::FCmp : llvm::Instruction::ICmp, pred, e0Val, e1Val,
--                                    LLVMGetName(opName, e0Val, e1Val));
-+                                    (((llvm::Twine(opName) + "_") + e0Val->getName()) + "_") + e1Val->getName());
-     // This is a little ugly: CmpInst returns i1 values, but we use vectors
-     // of i32s for varying bool values; type convert the result here if
-     // needed.
-@@ -4177,7 +4178,7 @@ static llvm::Value *lConvertToSlicePointer(FunctionEmitContext *ctx, llvm::Value
-     // offsets
-     llvm::Value *result = llvm::Constant::getNullValue(sliceStructType);
-     // And replace the pointer in the struct with the given pointer
--    return ctx->InsertInst(result, ptr, 0, LLVMGetName(ptr, "_slice"));
-+    return ctx->InsertInst(result, ptr, 0, llvm::Twine(ptr->getName()) + "_slice");
- }
- 
- /** If the given array index is a compile time constant, check to see if it
-@@ -4258,8 +4259,8 @@ llvm::Value *IndexExpr::GetLValue(FunctionEmitContext *ctx) const {
-         // Convert to a slice pointer if we're indexing into SOA data
-         basePtrValue = lConvertPtrToSliceIfNeeded(ctx, basePtrValue, &baseExprType);
- 
--        llvm::Value *ptr =
--            ctx->GetElementPtrInst(basePtrValue, indexValue, baseExprType, LLVMGetName(basePtrValue, "_offset"));
-+        llvm::Value *ptr = ctx->GetElementPtrInst(basePtrValue, indexValue, baseExprType,
-+                                                  llvm::Twine(basePtrValue->getName()) + "_offset");
-         return lAddVaryingOffsetsIfNeeded(ctx, ptr, GetLValueType());
-     }
- 
-@@ -4290,8 +4291,8 @@ llvm::Value *IndexExpr::GetLValue(FunctionEmitContext *ctx) const {
-     ctx->SetDebugPos(pos);
- 
-     // And do the actual indexing calculation..
--    llvm::Value *ptr =
--        ctx->GetElementPtrInst(basePtr, LLVMInt32(0), indexValue, basePtrType, LLVMGetName(basePtr, "_offset"));
-+    llvm::Value *ptr = ctx->GetElementPtrInst(basePtr, LLVMInt32(0), indexValue, basePtrType,
-+                                              llvm::Twine(basePtr->getName()) + "_offset");
-     return lAddVaryingOffsetsIfNeeded(ctx, ptr, GetLValueType());
- }
- 
-@@ -4788,15 +4789,14 @@ llvm::Value *VectorMemberExpr::GetValue(FunctionEmitContext *ctx) const {
-         for (size_t i = 0; i < identifier.size(); ++i) {
-             char idStr[2] = {identifier[i], '\0'};
-             llvm::Value *elementPtr =
--                ctx->AddElementOffset(basePtr, indices[i], basePtrType, LLVMGetName(basePtr, idStr));
-+                ctx->AddElementOffset(basePtr, indices[i], basePtrType, llvm::Twine(basePtr->getName()) + idStr);
-             llvm::Value *elementValue = ctx->LoadInst(elementPtr, elementMask, elementPtrType);
- 
--            const char *resultName = LLVMGetName(resultPtr, idStr);
--            llvm::Value *ptmp = ctx->AddElementOffset(resultPtr, i, NULL, resultName);
-+            llvm::Value *ptmp = ctx->AddElementOffset(resultPtr, i, NULL, llvm::Twine(resultPtr->getName()) + idStr);
-             ctx->StoreInst(elementValue, ptmp, elementPtrType, expr->GetType()->IsUniformType());
-         }
- 
--        return ctx->LoadInst(resultPtr, memberType, LLVMGetName(basePtr, "_swizzle"));
-+        return ctx->LoadInst(resultPtr, memberType, llvm::Twine(basePtr->getName()) + "_swizzle");
-     }
- }
- 
-@@ -4932,7 +4932,7 @@ llvm::Value *MemberExpr::GetValue(FunctionEmitContext *ctx) const {
- 
-     ctx->SetDebugPos(pos);
-     std::string suffix = std::string("_") + identifier;
--    return ctx->LoadInst(lvalue, mask, lvalueType, LLVMGetName(lvalue, suffix.c_str()));
-+    return ctx->LoadInst(lvalue, mask, lvalueType, llvm::Twine(lvalue->getName()) + suffix);
- }
- 
- const Type *MemberExpr::GetType() const { return NULL; }
-@@ -6502,7 +6502,7 @@ static llvm::Value *lTypeConvAtomic(FunctionEmitContext *ctx, llvm::Value *exprV
-                 // does for everyone else...
-                 Assert(cast);
-                 cast = ctx->SwitchBoolSize(cast, LLVMTypes::BoolVectorType->getElementType(),
--                                           LLVMGetName(cast, "to_i_bool"));
-+                                           llvm::Twine(cast->getName()) + "to_i_bool");
-             }
-         } else {
-             // fromType->IsVaryingType())
-@@ -8246,7 +8246,7 @@ llvm::Value *NewExpr::GetValue(FunctionEmitContext *ctx) const {
-         // pointer of the return type and to run the code for initializers,
-         // if present.
-         llvm::Type *ptrType = retType->LLVMType(g->ctx);
--        ptrValue = ctx->BitCastInst(ptrValue, ptrType, LLVMGetName(ptrValue, "_cast_ptr"));
-+        ptrValue = ctx->BitCastInst(ptrValue, ptrType, llvm::Twine(ptrValue->getName()) + "_cast_ptr");
- 
-         if (initExpr != NULL)
-             InitSymbol(ptrValue, allocType, initExpr, ctx, pos);
-diff --git a/src/llvmutil.cpp b/src/llvmutil.cpp
-index 970175dbf..d0becb9f5 100644
---- a/src/llvmutil.cpp
-+++ b/src/llvmutil.cpp
-@@ -1605,23 +1605,6 @@ llvm::Value *LLVMShuffleVectors(llvm::Value *v1, llvm::Value *v2, int32_t shuf[]
-     return new llvm::ShuffleVectorInst(v1, v2, vec, "shuffle", insertBefore);
- }
- 
--const char *LLVMGetName(llvm::Value *v, const char *s) {
--    if (v == NULL)
--        return s;
--    std::string ret = std::string(v->getName());
--    ret += s;
--    return strdup(ret.c_str());
--}
--
--const char *LLVMGetName(const char *op, llvm::Value *v1, llvm::Value *v2) {
--    std::string r = op;
--    r += "_";
--    r += v1->getName().str();
--    r += "_";
--    r += v2->getName().str();
--    return strdup(r.c_str());
--}
--
- #ifdef ISPC_GENX_ENABLED
- bool lIsSVMLoad(llvm::Instruction *inst) {
-     Assert(inst);
-diff --git a/src/llvmutil.h b/src/llvmutil.h
-index 42cce4d83..07d089bb4 100644
---- a/src/llvmutil.h
-+++ b/src/llvmutil.h
-@@ -328,11 +328,6 @@ extern llvm::Value *LLVMConcatVectors(llvm::Value *v1, llvm::Value *v2, llvm::In
- extern llvm::Value *LLVMShuffleVectors(llvm::Value *v1, llvm::Value *v2, int32_t shuf[], int shufSize,
-                                        llvm::Instruction *insertBefore);
- 
--/** Utility routines to concat strings with the names of existing values to
--    create meaningful new names for instruction values.
--*/
--extern const char *LLVMGetName(llvm::Value *v, const char *);
--extern const char *LLVMGetName(const char *op, llvm::Value *v1, llvm::Value *v2);
- #ifdef ISPC_GENX_ENABLED
- enum AddressSpace { Local, Global, External };
- 
-diff --git a/src/opt.cpp b/src/opt.cpp
-index 5b1ac7b63..9d6cae058 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -257,7 +257,7 @@ static bool lGetSourcePosFromMetadata(const llvm::Instruction *inst, SourcePos *
-     return true;
- }
- 
--static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, const char *name,
-+static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, const llvm::Twine &name,
-                                     llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[2] = {arg0, arg1};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[2]);
-@@ -265,21 +265,22 @@ static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llv
- }
- 
- static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, llvm::Value *arg2,
--                                    const char *name, llvm::Instruction *insertBefore = NULL) {
-+                                    const llvm::Twine &name, llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[3] = {arg0, arg1, arg2};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[3]);
-     return llvm::CallInst::Create(func, newArgArray, name, insertBefore);
- }
- 
- static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, llvm::Value *arg2,
--                                    llvm::Value *arg3, const char *name, llvm::Instruction *insertBefore = NULL) {
-+                                    llvm::Value *arg3, const llvm::Twine &name,
-+                                    llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[4] = {arg0, arg1, arg2, arg3};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[4]);
-     return llvm::CallInst::Create(func, newArgArray, name, insertBefore);
- }
- 
- static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, llvm::Value *arg2,
--                                    llvm::Value *arg3, llvm::Value *arg4, const char *name,
-+                                    llvm::Value *arg3, llvm::Value *arg4, const llvm::Twine &name,
-                                     llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[5] = {arg0, arg1, arg2, arg3, arg4};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[5]);
-@@ -287,7 +288,7 @@ static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llv
- }
- 
- static llvm::Instruction *lCallInst(llvm::Function *func, llvm::Value *arg0, llvm::Value *arg1, llvm::Value *arg2,
--                                    llvm::Value *arg3, llvm::Value *arg4, llvm::Value *arg5, const char *name,
-+                                    llvm::Value *arg3, llvm::Value *arg4, llvm::Value *arg5, const llvm::Twine &name,
-                                     llvm::Instruction *insertBefore = NULL) {
-     llvm::Value *args[6] = {arg0, arg1, arg2, arg3, arg4, arg5};
-     llvm::ArrayRef<llvm::Value *> newArgArray(&args[0], &args[6]);
-@@ -991,23 +992,24 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 llvm::Type *returnType = callInst->getType();
-                 Assert(llvm::isa<llvm::VectorType>(returnType));
-                 // cast the i8 * to the appropriate type
--                const char *name = LLVMGetName(callInst->getArgOperand(0), "_cast");
--                llvm::Value *castPtr = new llvm::BitCastInst(callInst->getArgOperand(0),
--                                                             llvm::PointerType::get(returnType, 0), name, callInst);
-+                llvm::Value *castPtr =
-+                    new llvm::BitCastInst(callInst->getArgOperand(0), llvm::PointerType::get(returnType, 0),
-+                                          llvm::Twine(callInst->getArgOperand(0)->getName()) + "_cast", callInst);
-                 lCopyMetadata(castPtr, callInst);
-                 int align;
-                 if (g->opt.forceAlignedMemory)
-                     align = g->target->getNativeVectorAlignment();
-                 else
-                     align = callInst->getCalledFunction() == avxMaskedLoad32 ? 4 : 8;
--                name = LLVMGetName(callInst->getArgOperand(0), "_load");
- #if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
--                llvm::Instruction *loadInst = new llvm::LoadInst(castPtr, name, false /* not volatile */,
--                                                                 llvm::MaybeAlign(align), (llvm::Instruction *)NULL);
-+                llvm::Instruction *loadInst =
-+                    new llvm::LoadInst(castPtr, llvm::Twine(callInst->getArgOperand(0)->getName()) + "_load",
-+                                       false /* not volatile */, llvm::MaybeAlign(align), (llvm::Instruction *)NULL);
- #else
-                 llvm::Instruction *loadInst = new llvm::LoadInst(
--                    llvm::dyn_cast<llvm::PointerType>(castPtr->getType())->getPointerElementType(), castPtr, name,
--                    false /* not volatile */, llvm::MaybeAlign(align).valueOrOne(), (llvm::Instruction *)NULL);
-+                    llvm::dyn_cast<llvm::PointerType>(castPtr->getType())->getPointerElementType(), castPtr,
-+                    llvm::Twine(callInst->getArgOperand(0)->getName()) + "_load", false /* not volatile */,
-+                    llvm::MaybeAlign(align).valueOrOne(), (llvm::Instruction *)NULL);
- #endif
-                 lCopyMetadata(loadInst, callInst);
-                 llvm::ReplaceInstWithInst(callInst, loadInst);
-@@ -1028,9 +1030,9 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 // all lanes storing, so replace with a regular store
-                 llvm::Value *rvalue = callInst->getArgOperand(2);
-                 llvm::Type *storeType = rvalue->getType();
--                const char *name = LLVMGetName(callInst->getArgOperand(0), "_ptrcast");
--                llvm::Value *castPtr = new llvm::BitCastInst(callInst->getArgOperand(0),
--                                                             llvm::PointerType::get(storeType, 0), name, callInst);
-+                llvm::Value *castPtr =
-+                    new llvm::BitCastInst(callInst->getArgOperand(0), llvm::PointerType::get(storeType, 0),
-+                                          llvm::Twine(callInst->getArgOperand(0)->getName()) + "_ptrcast", callInst);
-                 lCopyMetadata(castPtr, callInst);
- 
-                 int align;
-@@ -1339,8 +1341,8 @@ static llvm::Value *lGetBasePointer(llvm::Value *v, llvm::Instruction *insertBef
-         if (t == NULL) {
-             return NULL;
-         } else {
--            return llvm::CastInst::Create(ci->getOpcode(), t, ci->getType()->getScalarType(), LLVMGetName(t, "_cast"),
--                                          insertBefore);
-+            return llvm::CastInst::Create(ci->getOpcode(), t, ci->getType()->getScalarType(),
-+                                          llvm::Twine(t->getName()) + "_cast", insertBefore);
-         }
-     }
- 
-@@ -1583,13 +1585,13 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-         if (co == NULL)
-             *constOffset = NULL;
-         else
--            *constOffset =
--                llvm::CastInst::Create(cast->getOpcode(), co, cast->getType(), LLVMGetName(co, "_cast"), insertBefore);
-+            *constOffset = llvm::CastInst::Create(cast->getOpcode(), co, cast->getType(),
-+                                                  llvm::Twine(co->getName()) + "_cast", insertBefore);
-         if (vo == NULL)
-             *variableOffset = NULL;
-         else
--            *variableOffset =
--                llvm::CastInst::Create(cast->getOpcode(), vo, cast->getType(), LLVMGetName(vo, "_cast"), insertBefore);
-+            *variableOffset = llvm::CastInst::Create(cast->getOpcode(), vo, cast->getType(),
-+                                                     llvm::Twine(vo->getName()) + "_cast", insertBefore);
-         return;
-     }
- 
-@@ -1608,16 +1610,18 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-             else if (c1 == NULL || llvm::isa<llvm::ConstantAggregateZero>(c1))
-                 *constOffset = c0;
-             else
--                *constOffset = llvm::BinaryOperator::Create(llvm::Instruction::Add, c0, c1, LLVMGetName("add", c0, c1),
--                                                            insertBefore);
-+                *constOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Add, c0, c1, ((llvm::Twine("add_") + c0->getName()) + "_") + c1->getName(),
-+                    insertBefore);
- 
-             if (v0 == NULL || llvm::isa<llvm::ConstantAggregateZero>(v0))
-                 *variableOffset = v1;
-             else if (v1 == NULL || llvm::isa<llvm::ConstantAggregateZero>(v1))
-                 *variableOffset = v0;
-             else
--                *variableOffset = llvm::BinaryOperator::Create(llvm::Instruction::Add, v0, v1,
--                                                               LLVMGetName("add", v0, v1), insertBefore);
-+                *variableOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Add, v0, v1, ((llvm::Twine("add_") + v0->getName()) + "_") + v1->getName(),
-+                    insertBefore);
-             return;
-         } else if (bop->getOpcode() == llvm::Instruction::Shl) {
-             lExtractConstantOffset(op0, &c0, &v0, insertBefore);
-@@ -1633,10 +1637,12 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-                 *constOffset = vec;
-                 *variableOffset = NULL;
-             } else {
--                *constOffset = llvm::BinaryOperator::Create(llvm::Instruction::Shl, c0, c1, LLVMGetName("shl", c0, c1),
--                                                            insertBefore);
--                *variableOffset = llvm::BinaryOperator::Create(llvm::Instruction::Shl, v0, c1,
--                                                               LLVMGetName("shl", v0, c1), insertBefore);
-+                *constOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Shl, c0, c1, ((llvm::Twine("shl_") + c0->getName()) + "_") + c1->getName(),
-+                    insertBefore);
-+                *variableOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Shl, v0, c1, ((llvm::Twine("shl_") + v0->getName()) + "_") + c1->getName(),
-+                    insertBefore);
-             }
-             return;
-         } else if (bop->getOpcode() == llvm::Instruction::Mul) {
-@@ -1648,25 +1654,30 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-             // Note that the first term is a constant and the last three are
-             // variable.
-             if (c0 != NULL && c1 != NULL)
--                *constOffset = llvm::BinaryOperator::Create(llvm::Instruction::Mul, c0, c1, LLVMGetName("mul", c0, c1),
--                                                            insertBefore);
-+                *constOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Mul, c0, c1, ((llvm::Twine("mul_") + c0->getName()) + "_") + c1->getName(),
-+                    insertBefore);
-             else
-                 *constOffset = NULL;
- 
-             llvm::Value *va = NULL, *vb = NULL, *vc = NULL;
-             if (v0 != NULL && c1 != NULL)
--                va = llvm::BinaryOperator::Create(llvm::Instruction::Mul, v0, c1, LLVMGetName("mul", v0, c1),
-+                va = llvm::BinaryOperator::Create(llvm::Instruction::Mul, v0, c1,
-+                                                  ((llvm::Twine("mul_") + v0->getName()) + "_") + c1->getName(),
-                                                   insertBefore);
-             if (c0 != NULL && v1 != NULL)
--                vb = llvm::BinaryOperator::Create(llvm::Instruction::Mul, c0, v1, LLVMGetName("mul", c0, v1),
-+                vb = llvm::BinaryOperator::Create(llvm::Instruction::Mul, c0, v1,
-+                                                  ((llvm::Twine("mul_") + c0->getName()) + "_") + v1->getName(),
-                                                   insertBefore);
-             if (v0 != NULL && v1 != NULL)
--                vc = llvm::BinaryOperator::Create(llvm::Instruction::Mul, v0, v1, LLVMGetName("mul", v0, v1),
-+                vc = llvm::BinaryOperator::Create(llvm::Instruction::Mul, v0, v1,
-+                                                  ((llvm::Twine("mul_") + v0->getName()) + "_") + v1->getName(),
-                                                   insertBefore);
- 
-             llvm::Value *vab = NULL;
-             if (va != NULL && vb != NULL)
--                vab = llvm::BinaryOperator::Create(llvm::Instruction::Add, va, vb, LLVMGetName("add", va, vb),
-+                vab = llvm::BinaryOperator::Create(llvm::Instruction::Add, va, vb,
-+                                                   ((llvm::Twine("add_") + va->getName()) + "_") + vb->getName(),
-                                                    insertBefore);
-             else if (va != NULL)
-                 vab = va;
-@@ -1674,8 +1685,9 @@ static void lExtractConstantOffset(llvm::Value *vec, llvm::Value **constOffset,
-                 vab = vb;
- 
-             if (vab != NULL && vc != NULL)
--                *variableOffset = llvm::BinaryOperator::Create(llvm::Instruction::Add, vab, vc,
--                                                               LLVMGetName("add", vab, vc), insertBefore);
-+                *variableOffset = llvm::BinaryOperator::Create(
-+                    llvm::Instruction::Add, vab, vc, ((llvm::Twine("add_") + vab->getName()) + "_") + vc->getName(),
-+                    insertBefore);
-             else if (vab != NULL)
-                 *variableOffset = vab;
-             else
-@@ -1943,7 +1955,7 @@ static bool lOffsets32BitSafe(llvm::Value **variableOffsetPtr, llvm::Value **con
-             // all zeros (i.e. a ConstantAggregateZero, but just in case,
-             // do the more general check with lVectorIs32BitInts().
-             variableOffset = new llvm::TruncInst(variableOffset, LLVMTypes::Int32VectorType,
--                                                 LLVMGetName(variableOffset, "_trunc"), insertBefore);
-+                                                 llvm::Twine(variableOffset->getName()) + "_trunc", insertBefore);
-         else
-             return false;
-     }
-@@ -1952,7 +1964,7 @@ static bool lOffsets32BitSafe(llvm::Value **variableOffsetPtr, llvm::Value **con
-         if (lVectorIs32BitInts(constOffset)) {
-             // Truncate them so we have a 32-bit vector type for them.
-             constOffset = new llvm::TruncInst(constOffset, LLVMTypes::Int32VectorType,
--                                              LLVMGetName(constOffset, "_trunc"), insertBefore);
-+                                              llvm::Twine(constOffset->getName()) + "_trunc", insertBefore);
-         } else {
-             // FIXME: otherwise we just assume that all constant offsets
-             // can actually always fit into 32-bits...  (This could be
-@@ -1963,7 +1975,7 @@ static bool lOffsets32BitSafe(llvm::Value **variableOffsetPtr, llvm::Value **con
-             // llvm::ConstantFoldInstruction() doesn't seem to be doing
-             // enough for us in some cases if we call it from here.
-             constOffset = new llvm::TruncInst(constOffset, LLVMTypes::Int32VectorType,
--                                              LLVMGetName(constOffset, "_trunc"), insertBefore);
-+                                              llvm::Twine(constOffset->getName()) + "_trunc", insertBefore);
-         }
-     }
- 
-@@ -2012,8 +2024,8 @@ static bool lOffsets32BitSafe(llvm::Value **offsetPtr, llvm::Instruction *insert
- 
-         // Alternatively, offset could be a sequence of adds terminating
-         // in safe constant vectors or a SExt.
--        *offsetPtr =
--            new llvm::TruncInst(offset, LLVMTypes::Int32VectorType, LLVMGetName(offset, "_trunc"), insertBefore);
-+        *offsetPtr = new llvm::TruncInst(offset, LLVMTypes::Int32VectorType, llvm::Twine(offset->getName()) + "_trunc",
-+                                         insertBefore);
-         return true;
-     } else
-         return false;
-@@ -2229,7 +2241,8 @@ static bool lGSToGSBaseOffsets(llvm::CallInst *callInst) {
-     }
-     // Cast the base pointer to a void *, since that's what the
-     // __pseudo_*_base_offsets_* functions want.
--    basePtr = new llvm::IntToPtrInst(basePtr, LLVMTypes::VoidPointerType, LLVMGetName(basePtr, "_2void"), callInst);
-+    basePtr = new llvm::IntToPtrInst(basePtr, LLVMTypes::VoidPointerType, llvm::Twine(basePtr->getName()) + "_2void",
-+                                     callInst);
-     lCopyMetadata(basePtr, callInst);
-     llvm::Function *gatherScatterFunc = info->baseOffsetsFunc;
- 
-@@ -2803,7 +2816,7 @@ static bool lGSToLoadStore(llvm::CallInst *callInst) {
-                 lCopyMetadata(ptr, callInst);
-                 Debug(pos, "Transformed gather to unaligned vector load!");
-                 llvm::Instruction *newCall =
--                    lCallInst(gatherInfo->loadMaskedFunc, ptr, mask, LLVMGetName(ptr, "_masked_load"));
-+                    lCallInst(gatherInfo->loadMaskedFunc, ptr, mask, llvm::Twine(ptr->getName()) + "_masked_load");
-                 lCopyMetadata(newCall, callInst);
-                 llvm::ReplaceInstWithInst(callInst, newCall);
-                 return true;
diff --git a/srcpkgs/ispc/patches/llvm12-004.patch b/srcpkgs/ispc/patches/llvm12-004.patch
deleted file mode 100644
index 3a94d8443a5e..000000000000
--- a/srcpkgs/ispc/patches/llvm12-004.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From c03a5142444476a1caa5c2ba7fa2d92d7793d6f1 Mon Sep 17 00:00:00 2001
-From: Deepak Rajendrakumaran <deepak.rajendrakumaran@intel.com>
-Date: Mon, 25 Jan 2021 09:22:49 -0800
-Subject: [PATCH] Fixing build on llvm trunk.
-
----
- src/ctx.cpp | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index ded524b71..b60e6fe84 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1020,8 +1020,7 @@ void FunctionEmitContext::EmitCaseLabel(int value, bool checkMask, SourcePos pos
-     llvm::BasicBlock *bbCaseImpl = NULL;
-     if (emitGenXHardwareMask()) {
-         // Create basic block with actual case implementation
--        llvm::Twine bbName = llvm::Twine(bbCase->getName()) + "_impl";
--        bbCaseImpl = CreateBasicBlock(bbName, bbCase);
-+        bbCaseImpl = CreateBasicBlock(llvm::Twine(bbCase->getName()) + "_impl", bbCase);
-     }
- #endif
- 
-@@ -3142,8 +3141,8 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
-     llvm::Value *undef2 = llvm::UndefValue::get(vecType);
- 
-     // InsertElement
--    llvm::Twine tw = name.isTriviallyEmpty() ? (llvm::Twine(v->getName()) + "_broadcast") : name + llvm::Twine("_init");
--    llvm::Value *insert = InsertInst(undef1, v, 0, tw.str().c_str());
-+    llvm::Value *insert =
-+        InsertInst(undef1, v, 0, name.isTriviallyEmpty() ? (llvm::Twine(v->getName()) + "_broadcast") : name + "_init");
- 
-     // ShuffleVector
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
diff --git a/srcpkgs/ispc/patches/llvm12-005.patch b/srcpkgs/ispc/patches/llvm12-005.patch
deleted file mode 100644
index e3e96b00abfa..000000000000
--- a/srcpkgs/ispc/patches/llvm12-005.patch
+++ /dev/null
@@ -1,372 +0,0 @@
-From c1d0a51bf8416d42144de9e2bdd59825eaeff1ac Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Fri, 8 Jan 2021 14:13:49 -0800
-Subject: [PATCH] LLVM 11 support for gen code
-
----
- src/ctx.cpp                     |  13 ++-
- src/gen/GlobalsLocalization.cpp |   9 +-
- src/opt.cpp                     | 143 ++++++++++++++++++++++++--------
- 3 files changed, 124 insertions(+), 41 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index b60e6fe84..2a72e6837 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1,5 +1,5 @@
- /*
--  Copyright (c) 2010-2020, Intel Corporation
-+  Copyright (c) 2010-2021, Intel Corporation
-   All rights reserved.
- 
-   Redistribution and use in source and binary forms, with or without
-@@ -3685,8 +3685,17 @@ llvm::Value *FunctionEmitContext::GenXSimdCFPredicate(llvm::Value *value, llvm::
-     AssertPos(currentPos, llvm::isa<llvm::VectorType>(value->getType()));
-     llvm::VectorType *vt = llvm::dyn_cast<llvm::VectorType>(value->getType());
-     if (defaults == NULL) {
--        defaults = llvm::ConstantVector::getSplat(value->getType()->getVectorNumElements(),
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-+        defaults = llvm::ConstantVector::getSplat(vt->getVectorNumElements(),
-+                                                  llvm::Constant::getNullValue(vt->getElementType()));
-+#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+        defaults = llvm::ConstantVector::getSplat({static_cast<unsigned int>(vt->getNumElements()), false},
-                                                   llvm::Constant::getNullValue(vt->getElementType()));
-+#else
-+        defaults = llvm::ConstantVector::getSplat(
-+            llvm::ElementCount::get(static_cast<unsigned int>(vt->getNumElements()), false),
-+            llvm::Constant::getNullValue(vt->getElementType()));
-+#endif
-     }
- 
-     auto Fn = llvm::GenXIntrinsic::getGenXDeclaration(m->module, llvm::GenXIntrinsic::genx_simdcf_predicate,
-diff --git a/src/gen/GlobalsLocalization.cpp b/src/gen/GlobalsLocalization.cpp
-index a176e9462..41f3b00e2 100644
---- a/src/gen/GlobalsLocalization.cpp
-+++ b/src/gen/GlobalsLocalization.cpp
-@@ -1,5 +1,5 @@
- /*
--  Copyright (c) 2014, 2016-2020, Intel Corporation
-+  Copyright (c) 2014, 2016-2021, Intel Corporation
-   All rights reserved.
- 
-   Redistribution and use in source and binary forms, with or without
-@@ -53,8 +53,10 @@
- #include <llvm/GenXIntrinsics/GenXIntrOpts.h>
- #include <llvm/GenXIntrinsics/GenXIntrinsics.h>
- #include <llvm/GenXIntrinsics/GenXMetadata.h>
--#include <llvm/IR/CFG.h>
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
- #include <llvm/IR/CallSite.h>
-+#endif
-+#include <llvm/IR/CFG.h>
- #include <llvm/IR/DebugInfo.h>
- #include <llvm/IR/Dominators.h>
- #include <llvm/IR/Function.h>
-@@ -470,7 +472,8 @@ void GlobalsLocalization::LocalizeGlobals(LocalizationInfo &LI) {
-         Instruction &FirstI = *Fn->getEntryBlock().begin();
-         Type *ElemTy = GV->getType()->getElementType();
-         AllocaInst *Alloca = new AllocaInst(ElemTy, 0, GV->getName() + ".local", &FirstI);
--        Alloca->setAlignment(llvm::MaybeAlign(GV->getAlignment()));
-+        Alloca->setAlignment(llvm::MaybeAlign(GV->getAlignment()).valueOrOne());
-+
-         if (!isa<UndefValue>(GV->getInitializer()))
-             new StoreInst(GV->getInitializer(), Alloca, &FirstI);
- 
-diff --git a/src/opt.cpp b/src/opt.cpp
-index d58d77f73..1789b8476 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -2899,15 +2899,17 @@ static llvm::Function *lGenXMaskedInt8Inst(llvm::Instruction *inst, bool isStore
- static llvm::CallInst *lGenXStoreInst(llvm::Value *val, llvm::Value *ptr, llvm::Instruction *inst) {
-     Assert(g->target->isGenXTarget());
-     Assert(llvm::isa<llvm::VectorType>(val->getType()));
--    Assert(llvm::isPowerOf2_32(val->getType()->getVectorNumElements()));
--    Assert(val->getType()->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
-+
-+    llvm::VectorType *valVecType = llvm::dyn_cast<llvm::VectorType>(val->getType());
-+    Assert(llvm::isPowerOf2_32(valVecType->getNumElements()));
-+    Assert(valVecType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
- 
-     // The data write of svm store must have a size that is a power of two from 16 to 128
-     // bytes. However for int8 type and simd width = 8, the data write size is 8.
-     // So we use masked store function here instead of svm store which process int8 type
-     // correctly.
--    if (val->getType()->getPrimitiveSizeInBits() / 8 < 16) {
--        Assert(val->getType()->getScalarType() == LLVMTypes::Int8Type);
-+    if (valVecType->getPrimitiveSizeInBits() / 8 < 16) {
-+        Assert(valVecType->getScalarType() == LLVMTypes::Int8Type);
-         if (llvm::Function *maskedFunc = lGenXMaskedInt8Inst(inst, true))
-             return llvm::dyn_cast<llvm::CallInst>(lCallInst(maskedFunc, ptr, val, LLVMMaskAllOn, ""));
-         else {
-@@ -2923,15 +2925,17 @@ static llvm::CallInst *lGenXStoreInst(llvm::Value *val, llvm::Value *ptr, llvm::
- 
- static llvm::CallInst *lGenXLoadInst(llvm::Value *ptr, llvm::Type *retType, llvm::Instruction *inst) {
-     Assert(llvm::isa<llvm::VectorType>(retType));
--    Assert(llvm::isPowerOf2_32(retType->getVectorNumElements()));
--    Assert(retType->getPrimitiveSizeInBits());
--    Assert(retType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
-+
-+    llvm::VectorType *retVecType = llvm::dyn_cast<llvm::VectorType>(retType);
-+    Assert(llvm::isPowerOf2_32(retVecType->getNumElements()));
-+    Assert(retVecType->getPrimitiveSizeInBits());
-+    Assert(retVecType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
-     // The data read of svm load must have a size that is a power of two from 16 to 128
-     // bytes. However for int8 type and simd width = 8, the data read size is 8.
-     // So we use masked load function here instead of svm load which process int8 type
-     // correctly.
--    if (retType->getPrimitiveSizeInBits() / 8 < 16) {
--        Assert(retType->getScalarType() == LLVMTypes::Int8Type);
-+    if (retVecType->getPrimitiveSizeInBits() / 8 < 16) {
-+        Assert(retVecType->getScalarType() == LLVMTypes::Int8Type);
-         if (llvm::Function *maskedFunc = lGenXMaskedInt8Inst(inst, false))
-             return llvm::dyn_cast<llvm::CallInst>(lCallInst(maskedFunc, ptr, LLVMMaskAllOn, ""));
-         else {
-@@ -5622,15 +5626,24 @@ static bool lVectorizeGEPs(llvm::Value *ptr, std::vector<PtrUse> &ptrUses, std::
-         llvm::PtrToIntInst *ptrToInt =
-             new llvm::PtrToIntInst(ptr, LLVMTypes::Int64Type, "vectorized_ptrtoint", insertBefore);
-         llvm::Instruction *addr = llvm::BinaryOperator::CreateAdd(ptrToInt, offset, "vectorized_address", insertBefore);
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+        llvm::Type *retType = llvm::FixedVectorType::get(scalar_type, reqSize / t_size);
-+#else
-         llvm::Type *retType = llvm::VectorType::get(scalar_type, reqSize / t_size);
-+#endif
-         llvm::Function *fn = llvm::GenXIntrinsic::getGenXDeclaration(
-             m->module, llvm::GenXIntrinsic::genx_svm_block_ld_unaligned, {retType, addr->getType()});
-         llvm::Instruction *ld = llvm::CallInst::Create(fn, {addr}, "vectorized_ld", insertBefore);
- 
-         if (loadingPtr) {
-             // Cast int to ptr via inttoptr
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+            ld = new llvm::IntToPtrInst(ld, llvm::FixedVectorType::get(originalType, reqSize / t_size),
-+                                        "vectorized_inttoptr", insertBefore);
-+#else
-             ld = new llvm::IntToPtrInst(ld, llvm::VectorType::get(originalType, reqSize / t_size),
-                                         "vectorized_inttoptr", insertBefore);
-+#endif
-         }
- 
-         // Scalar extracts for all loaded elements
-@@ -6160,19 +6173,34 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
-         llvm::Instruction *inst = &*I;
-         if (llvm::CallInst *ci = llvm::dyn_cast<llvm::CallInst>(inst)) {
-             llvm::Function *func = ci->getCalledFunction();
--            if (func && func->getName() == "llvm.trap") {
-+            if (func && func->getName().equals("llvm.trap")) {
-                 llvm::Type *argTypes[] = {LLVMTypes::Int1VectorType, LLVMTypes::Int16VectorType};
-                 // Description of parameters for genx_raw_send_noresult can be found in target-genx.ll
-                 auto Fn = +llvm::GenXIntrinsic::getGenXDeclaration(
-                     m->module, llvm::GenXIntrinsic::genx_raw_send_noresult, argTypes);
-                 llvm::SmallVector<llvm::Value *, 8> Args;
-                 Args.push_back(llvm::ConstantInt::get(LLVMTypes::Int32Type, 0));
--                Args.push_back(llvm::ConstantVector::getSplat(g->target->getNativeVectorWidth(),
--                                                              llvm::ConstantInt::getTrue(*g->ctx)));
-+                Args.push_back(llvm::ConstantVector::getSplat(
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-+                    g->target->getNativeVectorWidth(),
-+#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+                    {static_cast<unsigned int>(g->target->getNativeVectorWidth()), false},
-+#else // LLVM 12.0+
-+                    llvm::ElementCount::get(static_cast<unsigned int>(g->target->getNativeVectorWidth()), false),
-+#endif
-+                    llvm::ConstantInt::getTrue(*g->ctx)));
-+
-                 Args.push_back(llvm::ConstantInt::get(LLVMTypes::Int32Type, 39));
-                 Args.push_back(llvm::ConstantInt::get(LLVMTypes::Int32Type, 33554448));
-                 llvm::Value *zeroMask = llvm::ConstantVector::getSplat(
--                    g->target->getNativeVectorWidth(), llvm::Constant::getNullValue(llvm::Type::getInt16Ty(*g->ctx)));
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-+                    g->target->getNativeVectorWidth(),
-+#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+                    {static_cast<unsigned int>(g->target->getNativeVectorWidth()), false},
-+#else // LLVM 12.0+
-+                    llvm::ElementCount::get(static_cast<unsigned int>(g->target->getNativeVectorWidth()), false),
-+#endif
-+                    llvm::Constant::getNullValue(llvm::Type::getInt16Ty(*g->ctx)));
-                 Args.push_back(zeroMask);
- 
-                 llvm::Instruction *newInst = llvm::CallInst::Create(Fn, Args, ci->getName());
-@@ -6181,7 +6209,7 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
-                     modifiedAny = true;
-                     goto restart;
-                 }
--            } else if (func && func->getName() == "llvm.assume") {
-+            } else if (func && func->getName().equals("llvm.assume")) {
-                 ci->eraseFromParent();
-                 modifiedAny = true;
-                 goto restart;
-@@ -6335,7 +6363,7 @@ bool CheckUnsupportedInsts::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 continue;
-             for (int i = 0; i < unsupportedFuncs.size(); i++) {
-                 std::smatch match;
--                std::string funcName = func->getName();
-+                std::string funcName = func->getName().str();
-                 if (std::regex_match(funcName, match, unsupportedFuncs[i])) {
-                     // We found unsupported function. Generate error and stop compilation.
-                     SourcePos pos;
-@@ -6418,12 +6446,14 @@ bool MangleOpenCLBuiltins::runOnBasicBlock(llvm::BasicBlock &bb) {
-             if (func->getName().startswith("__spirv_ocl")) {
-                 std::string mangledName;
-                 llvm::Type *retType = func->getReturnType();
--                std::string funcName = func->getName();
-+                std::string funcName = func->getName().str();
-                 std::vector<llvm::Type *> ArgTy;
-                 // spirv OpenCL builtins are used for double types only
--                Assert(retType->isVectorTy() && retType->getVectorElementType()->isDoubleTy() ||
-+                Assert(retType->isVectorTy() &&
-+                           llvm::dyn_cast<llvm::VectorType>(retType)->getElementType()->isDoubleTy() ||
-                        retType->isSingleValueType() && retType->isDoubleTy());
--                if (retType->isVectorTy() && retType->getVectorElementType()->isDoubleTy()) {
-+                if (retType->isVectorTy() &&
-+                    llvm::dyn_cast<llvm::VectorType>(retType)->getElementType()->isDoubleTy()) {
-                     ArgTy.push_back(LLVMTypes::DoubleVectorType);
-                     // _DvWIDTH suffix is used in target file to differentiate scalar
-                     // and vector versions of intrinsics. Here we remove this
-@@ -6511,8 +6541,15 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
- 
-     // Cast offsets to int64
-     Offsets = new llvm::ZExtInst(
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+        Offsets,
-+        llvm::FixedVectorType::get(LLVMTypes::Int64Type,
-+                                   llvm::dyn_cast<llvm::VectorType>(Offsets->getType())->getNumElements()),
-+        "svm_offset_zext", InsertBefore);
-+#else
-         Offsets, llvm::VectorType::get(LLVMTypes::Int64Type, Offsets->getType()->getVectorNumElements()),
-         "svm_offset_zext", InsertBefore);
-+#endif
- 
-     if (!llvm::isa<llvm::ConstantPointerNull>(Ptr)) {
-         // Cast ptr to int64
-@@ -6520,13 +6557,31 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
- 
-         // Vectorize ptr
-         llvm::Value *undefInsertValue =
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+            llvm::UndefValue::get(llvm::FixedVectorType::get(
-+                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements()));
-+#else
-             llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int64Type, addressType->getVectorNumElements()));
-+#endif
-         address = llvm::InsertElementInst::Create(undefInsertValue, address, LLVMInt32(0), "svm_ptr_iei", InsertBefore);
-         llvm::Constant *zeroVec = llvm::ConstantVector::getSplat(
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-             addressType->getVectorNumElements(),
-+#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+            {llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements(), false},
-+#else
-+        llvm::ElementCount::get(
-+                                llvm::dyn_cast<llvm::FixedVectorType>(addressType->getNumElements(), false),
-+#endif
-             llvm::Constant::getNullValue(llvm::Type::getInt32Ty(InsertBefore->getContext())));
-+
-         llvm::Value *undefShuffleValue =
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+            llvm::UndefValue::get(llvm::FixedVectorType::get(
-+                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements()));
-+#else
-             llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int64Type, addressType->getVectorNumElements()));
-+#endif
-         address = new llvm::ShuffleVectorInst(address, undefShuffleValue, zeroVec, "svm_ptr_svi", InsertBefore);
- 
-         // Calculate address
-@@ -6553,9 +6608,12 @@ llvm::Instruction *FixAddressSpace::processVectorLoad(llvm::LoadInst *LI) {
-     if (retType->getScalarType()->isPointerTy()) {
-         isPtrLoad = true;
-         auto scalarType = g->target->is32Bit() ? LLVMTypes::Int32Type : LLVMTypes::Int64Type;
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+        retType = llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::VectorType>(retType)->getNumElements());
-+#else
-         retType = llvm::VectorType::get(scalarType, retType->getVectorNumElements());
-+#endif
-     }
--
-     llvm::Instruction *res = lGenXLoadInst(ptr, retType, llvm::dyn_cast<llvm::Instruction>(LI));
-     Assert(res);
- 
-@@ -6580,11 +6638,16 @@ llvm::Instruction *FixAddressSpace::processSVMVectorLoad(llvm::Instruction *CI)
-     ptr = new llvm::IntToPtrInst(ptr, llvm::PointerType::get(retType, 0), CI->getName() + "_inttoptr", CI);
-     llvm::Instruction *loadInst = NULL;
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--    loadInst = new llvm::LoadInst(llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(), loadInst,
--                                  CI->getName(), (llvm::Instruction *)NULL);
-+    loadInst = new llvm::LoadInst(llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(), ptr,
-+                                  CI->getName(), false /* not volatile */,
-+                                  llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne(),
-+                                  (llvm::Instruction *)NULL);
- #else
--    loadInst = new llvm::LoadInst(ptr, CI->getName(), (llvm::Instruction *)NULL);
-+    loadInst = new llvm::LoadInst(ptr, CI->getName(), false,
-+                                  llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne(),
-+                                  (llvm::Instruction *)NULL);
- #endif
-+
-     Assert(loadInst);
-     return loadInst;
- }
-@@ -6606,7 +6669,11 @@ llvm::Instruction *FixAddressSpace::processVectorStore(llvm::StoreInst *SI) {
-     // Note: it doesn't look like a normal case for GenX target
-     if (valType->getScalarType()->isPointerTy()) {
-         auto scalarType = g->target->is32Bit() ? LLVMTypes::Int32Type : LLVMTypes::Int64Type;
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+        valType = llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::VectorType>(valType)->getNumElements());
-+#else
-         valType = llvm::VectorType::get(scalarType, valType->getVectorNumElements());
-+#endif
-         val = new llvm::PtrToIntInst(val, valType, "svm_st_val_ptrtoint", SI);
-     }
- 
-@@ -6631,12 +6698,8 @@ llvm::Instruction *FixAddressSpace::processSVMVectorStore(llvm::Instruction *CI)
-     ptr = new llvm::IntToPtrInst(ptr, llvm::PointerType::get(valType, 0), CI->getName() + "_inttoptr", CI);
- 
-     llvm::Instruction *storeInst = NULL;
--#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--    loadInst = new llvm::StoreInst(val, llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(),
--                                   storeInst, CI->getName(), (llvm::Instruction *)NULL);
--#else
--    storeInst = new llvm::StoreInst(val, ptr, (llvm::Instruction *)NULL);
--#endif
-+    storeInst = new llvm::StoreInst(val, ptr, (llvm::Instruction *)NULL,
-+                                    llvm::MaybeAlign(g->target->getNativeVectorAlignment()).valueOrOne());
-     Assert(storeInst);
-     return storeInst;
- }
-@@ -6645,15 +6708,18 @@ llvm::Instruction *FixAddressSpace::createInt8WrRegion(llvm::Value *Val, llvm::V
-     int width = g->target->getVectorWidth();
- 
-     llvm::Value *Args[8];
--
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    Args[0] = llvm::UndefValue::get(llvm::FixedVectorType::get(LLVMTypes::Int8Type, width * 4)); // old value
-+#else
-     Args[0] = llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int8Type, width * 4)); // old value
--    Args[1] = Val;                                                                          // value to store
--    Args[2] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 0);                              // vstride
--    Args[3] = llvm::ConstantInt::get(LLVMTypes::Int32Type, width);                          // width
--    Args[4] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 4);                              // stride
--    Args[5] = llvm::ConstantInt::get(LLVMTypes::Int16Type, 0);                              // offsets
--    Args[6] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 0);                              // parent width (ignored)
--    Args[7] = Mask;                                                                         // mask
-+#endif
-+    Args[1] = Val;                                                 // value to store
-+    Args[2] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 0);     // vstride
-+    Args[3] = llvm::ConstantInt::get(LLVMTypes::Int32Type, width); // width
-+    Args[4] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 4);     // stride
-+    Args[5] = llvm::ConstantInt::get(LLVMTypes::Int16Type, 0);     // offsets
-+    Args[6] = llvm::ConstantInt::get(LLVMTypes::Int32Type, 0);     // parent width (ignored)
-+    Args[7] = Mask;                                                // mask
- 
-     llvm::Type *Tys[4];
- 
-@@ -6708,7 +6774,12 @@ llvm::Instruction *FixAddressSpace::processGatherScatterPrivate(llvm::CallInst *
-         return NULL;
- 
-     llvm::Value *address = calculateGatherScatterAddress(ptr, offsets, CI);
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    llvm::Type *i8VecType = llvm::FixedVectorType::get(LLVMTypes::Int8Type, width * 4);
-+#else
-     llvm::Type *i8VecType = llvm::VectorType::get(LLVMTypes::Int8Type, width * 4);
-+#endif
-+
-     bool isInt8 = (value->getType()->getScalarType() == LLVMTypes::Int8Type);
- 
-     Assert(address && "Bad gather/scatter address!");
diff --git a/srcpkgs/ispc/patches/llvm12-006.patch b/srcpkgs/ispc/patches/llvm12-006.patch
deleted file mode 100644
index a829ea48391e..000000000000
--- a/srcpkgs/ispc/patches/llvm12-006.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-From bb3f493d1fbd45c79e1d9dee67a0430ba313eaad Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Tue, 19 Jan 2021 11:07:33 -0800
-Subject: [PATCH] Fixed ifdefs for LLVM_11
-
----
- src/ctx.cpp |  6 +++---
- src/opt.cpp | 18 +++++++++---------
- 2 files changed, 12 insertions(+), 12 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 2a72e6837..527a02f30 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -1691,7 +1691,7 @@ llvm::Value *FunctionEmitContext::SmearUniform(llvm::Value *value, const llvm::T
-     if (llvm::Constant *const_val = llvm::dyn_cast<llvm::Constant>(value)) {
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-         ret = llvm::ConstantVector::getSplat(g->target->getVectorWidth(), const_val);
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-         ret =
-             llvm::ConstantVector::getSplat({static_cast<unsigned int>(g->target->getVectorWidth()), false}, const_val);
- #else // LLVM 12.0+
-@@ -3148,7 +3148,7 @@ llvm::Value *FunctionEmitContext::BroadcastValue(llvm::Value *v, llvm::Type *vec
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-     llvm::Constant *zeroVec = llvm::ConstantVector::getSplat(
-         vecType->getVectorNumElements(), llvm::Constant::getNullValue(llvm::Type::getInt32Ty(*g->ctx)));
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-     llvm::Constant *zeroVec =
-         llvm::ConstantVector::getSplat({static_cast<unsigned int>(ty->getNumElements()), false},
-                                        llvm::Constant::getNullValue(llvm::Type::getInt32Ty(*g->ctx)));
-@@ -3688,7 +3688,7 @@ llvm::Value *FunctionEmitContext::GenXSimdCFPredicate(llvm::Value *value, llvm::
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-         defaults = llvm::ConstantVector::getSplat(vt->getVectorNumElements(),
-                                                   llvm::Constant::getNullValue(vt->getElementType()));
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-         defaults = llvm::ConstantVector::getSplat({static_cast<unsigned int>(vt->getNumElements()), false},
-                                                   llvm::Constant::getNullValue(vt->getElementType()));
- #else
-diff --git a/src/opt.cpp b/src/opt.cpp
-index 1789b8476..3ff191a0a 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -1045,7 +1045,7 @@ bool IntrinsicsOpt::runOnBasicBlock(llvm::BasicBlock &bb) {
-                     align = g->target->getNativeVectorAlignment();
-                 else
-                     align = callInst->getCalledFunction() == avxMaskedLoad32 ? 4 : 8;
--#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                 llvm::Instruction *loadInst =
-                     new llvm::LoadInst(castPtr, llvm::Twine(callInst->getArgOperand(0)->getName()) + "_load",
-                                        false /* not volatile */, llvm::MaybeAlign(align), (llvm::Instruction *)NULL);
-@@ -1472,7 +1472,7 @@ static llvm::Value *lGetBasePtrAndOffsets(llvm::Value *ptrs, llvm::Value **offse
-                     llvm::Value *zeroMask =
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                         llvm::ConstantVector::getSplat(cv->getType()->getVectorNumElements(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                         llvm::ConstantVector::getSplat(
-                             {llvm::dyn_cast<llvm::VectorType>(cv->getType())->getNumElements(), false},
- #else // LLVM 12.0+
-@@ -1495,7 +1495,7 @@ static llvm::Value *lGetBasePtrAndOffsets(llvm::Value *ptrs, llvm::Value **offse
-                         llvm::Value *zeroMask = llvm::ConstantVector::getSplat(
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                             bop_var_type->getVectorNumElements(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                             {llvm::dyn_cast<llvm::VectorType>(bop_var_type)->getNumElements(), false},
- #else // LLVM 12.0+
-                             llvm::ElementCount::get(
-@@ -2803,7 +2803,7 @@ static bool lGSToLoadStore(llvm::CallInst *callInst) {
-             llvm::Value *zeroMask =
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                 llvm::ConstantVector::getSplat(callInst->getType()->getVectorNumElements(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                 llvm::ConstantVector::getSplat(
-                     {llvm::dyn_cast<llvm::VectorType>(callInst->getType())->getNumElements(), false},
- 
-@@ -3100,7 +3100,7 @@ static bool lImproveMaskedLoad(llvm::CallInst *callInst, llvm::BasicBlock::itera
-         {
-             llvm::Type *ptrType = llvm::PointerType::get(callInst->getType(), 0);
-             ptr = new llvm::BitCastInst(ptr, ptrType, "ptr_cast_for_load", callInst);
--#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-             load = new llvm::LoadInst(
-                 ptr, callInst->getName(), false /* not volatile */,
-                 llvm::MaybeAlign(g->opt.forceAlignedMemory ? g->target->getNativeVectorAlignment() : info->align)
-@@ -3459,7 +3459,7 @@ llvm::Value *lGEPAndLoad(llvm::Value *basePtr, int64_t offset, int align, llvm::
-                          llvm::Type *type) {
-     llvm::Value *ptr = lGEPInst(basePtr, LLVMInt64(offset), "new_base", insertBefore);
-     ptr = new llvm::BitCastInst(ptr, llvm::PointerType::get(type, 0), "ptr_cast", insertBefore);
--#if ISPC_LLVM_VERSION == ISPC_LLVM_10_0
-+#if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-     return new llvm::LoadInst(ptr, "gather_load", false /* not volatile */, llvm::MaybeAlign(align), insertBefore);
- #else // LLVM 11.0+
-     return new llvm::LoadInst(llvm::dyn_cast<llvm::PointerType>(ptr->getType())->getPointerElementType(), ptr,
-@@ -6183,7 +6183,7 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 Args.push_back(llvm::ConstantVector::getSplat(
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                     g->target->getNativeVectorWidth(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                     {static_cast<unsigned int>(g->target->getNativeVectorWidth()), false},
- #else // LLVM 12.0+
-                     llvm::ElementCount::get(static_cast<unsigned int>(g->target->getNativeVectorWidth()), false),
-@@ -6195,7 +6195,7 @@ bool ReplaceLLVMIntrinsics::runOnBasicBlock(llvm::BasicBlock &bb) {
-                 llvm::Value *zeroMask = llvm::ConstantVector::getSplat(
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-                     g->target->getNativeVectorWidth(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-                     {static_cast<unsigned int>(g->target->getNativeVectorWidth()), false},
- #else // LLVM 12.0+
-                     llvm::ElementCount::get(static_cast<unsigned int>(g->target->getNativeVectorWidth()), false),
-@@ -6567,7 +6567,7 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
-         llvm::Constant *zeroVec = llvm::ConstantVector::getSplat(
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-             addressType->getVectorNumElements(),
--#elif ISPC_LLVM_VERSION == ISPC_LLVM_11_0
-+#elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
-             {llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements(), false},
- #else
-         llvm::ElementCount::get(
diff --git a/srcpkgs/ispc/patches/llvm12-007.patch b/srcpkgs/ispc/patches/llvm12-007.patch
deleted file mode 100644
index 1b975f896c7e..000000000000
--- a/srcpkgs/ispc/patches/llvm12-007.patch
+++ /dev/null
@@ -1,160 +0,0 @@
-From 62f5a6c37bf26fc25a7cf81868052d3472874610 Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Tue, 23 Mar 2021 23:07:30 -0700
-Subject: [PATCH] Do not generate function mask when it is not required
-
----
- src/ctx.cpp                    | 39 ++++++++++++++-------
- tests/lit-tests/full_mask.ispc | 63 ++++++++++++++++++++++++++++++++++
- 2 files changed, 90 insertions(+), 12 deletions(-)
- create mode 100644 tests/lit-tests/full_mask.ispc
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 527a02f30..9e775fc5c 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -231,10 +231,18 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym, llvm::F
-     internalMaskPointer = AllocaInst(LLVMTypes::MaskType, "internal_mask_memory");
-     StoreInst(LLVMMaskAllOn, internalMaskPointer);
- 
--    functionMaskValue = LLVMMaskAllOn;
--
--    fullMaskPointer = AllocaInst(LLVMTypes::MaskType, "full_mask_memory");
--    StoreInst(LLVMMaskAllOn, fullMaskPointer);
-+    // If the function doesn't have __mask in parameters, there is no need to
-+    // have function mask
-+    if ((func->GetType()->isExported &&
-+         (lf->getFunctionType()->getNumParams() == func->GetType()->GetNumParameters())) ||
-+        (func->GetType()->isUnmasked) || (func->GetType()->isTask)) {
-+        functionMaskValue = NULL;
-+        fullMaskPointer = NULL;
-+    } else {
-+        functionMaskValue = LLVMMaskAllOn;
-+        fullMaskPointer = AllocaInst(LLVMTypes::MaskType, "full_mask_memory");
-+        StoreInst(LLVMMaskAllOn, fullMaskPointer);
-+    }
- 
-     blockEntryMask = NULL;
-     breakLanesPtr = continueLanesPtr = NULL;
-@@ -389,20 +397,26 @@ llvm::BasicBlock *FunctionEmitContext::GetCurrentBasicBlock() { return bblock; }
- 
- void FunctionEmitContext::SetCurrentBasicBlock(llvm::BasicBlock *bb) { bblock = bb; }
- 
--llvm::Value *FunctionEmitContext::GetFunctionMask() { return functionMaskValue; }
-+llvm::Value *FunctionEmitContext::GetFunctionMask() { return fullMaskPointer ? functionMaskValue : LLVMMaskAllOn; }
- 
- llvm::Value *FunctionEmitContext::GetInternalMask() { return LoadInst(internalMaskPointer, NULL, "load_mask"); }
- 
- llvm::Value *FunctionEmitContext::GetFullMask() {
--    return BinaryOperator(llvm::Instruction::And, GetInternalMask(), functionMaskValue, "internal_mask&function_mask");
-+    return fullMaskPointer ? BinaryOperator(llvm::Instruction::And, GetInternalMask(), functionMaskValue,
-+                                            "internal_mask&function_mask")
-+                           : GetInternalMask();
- }
- 
--llvm::Value *FunctionEmitContext::GetFullMaskPointer() { return fullMaskPointer; }
-+llvm::Value *FunctionEmitContext::GetFullMaskPointer() {
-+    return fullMaskPointer ? fullMaskPointer : internalMaskPointer;
-+}
- 
- void FunctionEmitContext::SetFunctionMask(llvm::Value *value) {
--    functionMaskValue = value;
--    if (bblock != NULL)
--        StoreInst(GetFullMask(), fullMaskPointer);
-+    if (fullMaskPointer != NULL) {
-+        functionMaskValue = value;
-+        if (bblock != NULL)
-+            StoreInst(GetFullMask(), fullMaskPointer);
-+    }
- }
- 
- void FunctionEmitContext::SetBlockEntryMask(llvm::Value *value) { blockEntryMask = value; }
-@@ -410,7 +424,8 @@ void FunctionEmitContext::SetBlockEntryMask(llvm::Value *value) { blockEntryMask
- void FunctionEmitContext::SetInternalMask(llvm::Value *value) {
-     StoreInst(value, internalMaskPointer);
-     // kludge so that __mask returns the right value in ispc code.
--    StoreInst(GetFullMask(), fullMaskPointer);
-+    if (fullMaskPointer)
-+        StoreInst(GetFullMask(), fullMaskPointer);
- }
- 
- void FunctionEmitContext::SetInternalMaskAnd(llvm::Value *oldMask, llvm::Value *test) {
-@@ -1265,7 +1280,7 @@ void FunctionEmitContext::CurrentLanesReturned(Expr *expr, bool doCoherenceCheck
-         // lanes have returned
-         if (doCoherenceCheck) {
-             // if newReturnedLanes == functionMaskValue, get out of here!
--            llvm::Value *cmp = MasksAllEqual(functionMaskValue, newReturnedLanes);
-+            llvm::Value *cmp = MasksAllEqual(GetFunctionMask(), newReturnedLanes);
-             llvm::BasicBlock *bDoReturn = CreateBasicBlock("do_return");
-             llvm::BasicBlock *bNoReturn = CreateBasicBlock("no_return");
-             BranchInst(bDoReturn, bNoReturn, cmp);
-diff --git a/tests/lit-tests/full_mask.ispc b/tests/lit-tests/full_mask.ispc
-new file mode 100644
-index 000000000..ac0b0bca3
---- /dev/null
-+++ b/tests/lit-tests/full_mask.ispc
-@@ -0,0 +1,63 @@
-+// RUN: %{ispc} %s -DISPC_EXPORT --emit-llvm-text -O0 --nowrap -o %t.ll
-+// RUN: FileCheck --input-file=%t.ll -check-prefix=CHECK_ISPC_EXPORT %s
-+
-+// RUN: %{ispc} %s -DISPC_UNMASKED --emit-llvm-text -O0 --nowrap -o %t.ll
-+// RUN: FileCheck --input-file=%t.ll -check-prefix=CHECK_ISPC_UNMASKED %s
-+
-+// RUN: %{ispc} %s -DISPC_NOQUALIF --emit-llvm-text -O0 --nowrap -o %t.ll
-+// RUN: FileCheck --input-file=%t.ll -check-prefix=CHECK_ISPC_NOQUALIF %s
-+
-+// RUN: %{ispc} %s -DISPC_TASK --emit-llvm-text -O0 --nowrap -o %t.ll
-+// RUN: FileCheck --input-file=%t.ll -check-prefix=CHECK_ISPC_TASK %s
-+
-+struct Parameters {
-+    float *vout;
-+    int param;
-+};
-+
-+#ifdef ISPC_EXPORT
-+// CHECK_ISPC_EXPORT: define void @simple_export___
-+// CHECK_ISPC_EXPORT: %full_mask_memory = alloca
-+// CHECK_ISPC_EXPORT: define void @simple_export(
-+// CHECK_ISPC_EXPORT-NOT: %full_mask_memory = alloca
-+export void simple_export(void *uniform _p) {
-+    Parameters *uniform p = (Parameters * uniform) _p;
-+    if (programIndex > p->param)
-+        p->vout[programIndex] = programCount * programIndex;
-+}
-+#endif
-+#ifdef ISPC_UNMASKED
-+// CHECK_ISPC_UNMASKED: define void @simple_unmasked
-+// CHECK_ISPC_UNMASKED-NOT: %full_mask_memory = alloca
-+unmasked void simple_unmasked(void *uniform _p) {
-+    Parameters *uniform p = (Parameters * uniform) _p;
-+    if (programIndex > p->param)
-+        p->vout[programIndex] = programCount * programIndex;
-+}
-+#endif
-+#ifdef ISPC_NOQUALIF
-+// CHECK_ISPC_NOQUALIF: define void @simple
-+// CHECK_ISPC_NOQUALIF: %full_mask_memory = alloca
-+void simple(void *uniform _p) {
-+    Parameters *uniform p = (Parameters * uniform) _p;
-+    if (programIndex > p->param)
-+        p->vout[programIndex] = programCount * programIndex;
-+}
-+#endif
-+#ifdef ISPC_TASK
-+
-+// CHECK_ISPC_TASK: define void @simple_task
-+// CHECK_ISPC_TASK-NOT: %full_mask_memory = alloca
-+// CHECK_ISPC_TASK: define void @simple_entry_point__
-+// CHECK_ISPC_TASK: %full_mask_memory = alloca
-+// CHECK_ISPC_TASK: define void @simple_entry_point(
-+// CHECK_ISPC_TASK-NOT: %full_mask_memory = alloca
-+task void simple_task(void *uniform _p) {
-+    Parameters *uniform p = (Parameters * uniform) _p;
-+    if (programIndex > p->param)
-+        p->vout[programIndex] = programCount * programIndex;
-+}
-+export void simple_entry_point(void *uniform parameters, uniform int dim0, uniform int dim1, uniform int dim2) {
-+    launch[dim0, dim1, dim2] simple_task(parameters);
-+}
-+#endif
-\ No newline at end of file
diff --git a/srcpkgs/ispc/patches/llvm12-008.patch b/srcpkgs/ispc/patches/llvm12-008.patch
deleted file mode 100644
index c8413d8b7887..000000000000
--- a/srcpkgs/ispc/patches/llvm12-008.patch
+++ /dev/null
@@ -1,149 +0,0 @@
-From afad14227d9204a3c8a626ca608f5b43c3218fe9 Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Tue, 4 May 2021 11:43:52 -0700
-Subject: [PATCH] Fixed ISPC gen build for LLVM12
-
----
- src/ctx.cpp |  4 ++++
- src/opt.cpp | 43 +++++++++++++++++++++++++++++--------------
- 2 files changed, 33 insertions(+), 14 deletions(-)
-
-diff --git a/src/ctx.cpp b/src/ctx.cpp
-index 0c7050591..f7dc06939 100644
---- a/src/ctx.cpp
-+++ b/src/ctx.cpp
-@@ -3738,7 +3738,11 @@ llvm::Value *FunctionEmitContext::GenXSimdCFAny(llvm::Value *value) {
- 
- llvm::Value *FunctionEmitContext::GenXSimdCFPredicate(llvm::Value *value, llvm::Value *defaults) {
-     AssertPos(currentPos, llvm::isa<llvm::VectorType>(value->getType()));
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    llvm::FixedVectorType *vt = llvm::dyn_cast<llvm::FixedVectorType>(value->getType());
-+#else
-     llvm::VectorType *vt = llvm::dyn_cast<llvm::VectorType>(value->getType());
-+#endif
-     if (defaults == NULL) {
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-         defaults = llvm::ConstantVector::getSplat(vt->getVectorNumElements(),
-diff --git a/src/opt.cpp b/src/opt.cpp
-index cea4afa23..4e33d6b1a 100644
---- a/src/opt.cpp
-+++ b/src/opt.cpp
-@@ -2916,9 +2916,13 @@ static llvm::Function *lGenXMaskedInt8Inst(llvm::Instruction *inst, bool isStore
- 
- static llvm::CallInst *lGenXStoreInst(llvm::Value *val, llvm::Value *ptr, llvm::Instruction *inst) {
-     Assert(g->target->isGenXTarget());
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    Assert(llvm::isa<llvm::FixedVectorType>(val->getType()));
-+    llvm::FixedVectorType *valVecType = llvm::dyn_cast<llvm::FixedVectorType>(val->getType());
-+#else
-     Assert(llvm::isa<llvm::VectorType>(val->getType()));
--
-     llvm::VectorType *valVecType = llvm::dyn_cast<llvm::VectorType>(val->getType());
-+#endif
-     Assert(llvm::isPowerOf2_32(valVecType->getNumElements()));
-     Assert(valVecType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
- 
-@@ -2942,9 +2946,13 @@ static llvm::CallInst *lGenXStoreInst(llvm::Value *val, llvm::Value *ptr, llvm::
- }
- 
- static llvm::CallInst *lGenXLoadInst(llvm::Value *ptr, llvm::Type *retType, llvm::Instruction *inst) {
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+    Assert(llvm::isa<llvm::FixedVectorType>(retType));
-+    llvm::FixedVectorType *retVecType = llvm::dyn_cast<llvm::FixedVectorType>(retType);
-+#else
-     Assert(llvm::isa<llvm::VectorType>(retType));
--
-     llvm::VectorType *retVecType = llvm::dyn_cast<llvm::VectorType>(retType);
-+#endif
-     Assert(llvm::isPowerOf2_32(retVecType->getNumElements()));
-     Assert(retVecType->getPrimitiveSizeInBits());
-     Assert(retVecType->getPrimitiveSizeInBits() / 8 <= 8 * OWORD);
-@@ -5485,8 +5493,13 @@ static void lCreateBlockLDUse(llvm::Instruction *currInst, std::vector<llvm::Ext
-         } else if (auto gather = lGetPseudoGather(llvm::dyn_cast<llvm::Instruction>(ui->getUser()))) {
-             // Collect idxs from gather and fix users
-             llvm::Value *res = llvm::UndefValue::get(gather->getType());
--            for (unsigned i = 0, end = llvm::dyn_cast<llvm::VectorType>(res->getType())->getNumElements(); i < end;
--                 ++i) {
-+#if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-+            for (unsigned i = 0, end = llvm::dyn_cast<llvm::FixedVectorType>(res->getType())->getNumElements(); i < end;
-+                 ++i)
-+#else
-+            for (unsigned i = 0, end = llvm::dyn_cast<llvm::VectorType>(res->getType())->getNumElements(); i < end; ++i)
-+#endif
-+            {
-                 // Get element via IEI
-                 res = llvm::InsertElementInst::Create(res, EEIs[ptrUse.idxs[curr_idx++]],
-                                                       llvm::ConstantInt::get(LLVMTypes::Int32Type, i),
-@@ -5522,10 +5535,11 @@ static bool lVectorizeGEPs(llvm::Value *ptr, std::vector<PtrUse> &ptrUses, std::
- 
-     // Adjust values for vector load
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--    if (auto vecTy = llvm::dyn_cast<llvm::FixedVectorType>(type)) {
-+    if (auto vecTy = llvm::dyn_cast<llvm::FixedVectorType>(type))
- #else
--    if (auto vecTy = llvm::dyn_cast<llvm::VectorType>(type)) {
-+    if (auto vecTy = llvm::dyn_cast<llvm::VectorType>(type))
- #endif
-+    {
-         // Get single element size
-         t_size /= vecTy->getNumElements();
-         // Get single element type
-@@ -6477,7 +6491,7 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-         Offsets,
-         llvm::FixedVectorType::get(LLVMTypes::Int64Type,
--                                   llvm::dyn_cast<llvm::VectorType>(Offsets->getType())->getNumElements()),
-+                                   llvm::dyn_cast<llvm::FixedVectorType>(Offsets->getType())->getNumElements()),
-         "svm_offset_zext", InsertBefore);
- #else
-         Offsets, llvm::VectorType::get(LLVMTypes::Int64Type, Offsets->getType()->getVectorNumElements()),
-@@ -6492,7 +6506,7 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
-         llvm::Value *undefInsertValue =
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-             llvm::UndefValue::get(llvm::FixedVectorType::get(
--                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements()));
-+                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::FixedVectorType>(addressType)->getNumElements()));
- #else
-             llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int64Type, addressType->getVectorNumElements()));
- #endif
-@@ -6501,17 +6515,16 @@ llvm::Value *FixAddressSpace::calculateGatherScatterAddress(llvm::Value *Ptr, ll
- #if ISPC_LLVM_VERSION < ISPC_LLVM_11_0
-             addressType->getVectorNumElements(),
- #elif ISPC_LLVM_VERSION < ISPC_LLVM_12_0
--            {llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements(), false},
-+            {llvm::dyn_cast<llvm::FixedVectorType>(addressType)->getNumElements(), false},
- #else
--        llvm::ElementCount::get(
--                                llvm::dyn_cast<llvm::FixedVectorType>(addressType->getNumElements(), false),
-+            llvm::ElementCount::get(llvm::dyn_cast<llvm::FixedVectorType>(addressType)->getNumElements(), false),
- #endif
-             llvm::Constant::getNullValue(llvm::Type::getInt32Ty(InsertBefore->getContext())));
- 
-         llvm::Value *undefShuffleValue =
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
-             llvm::UndefValue::get(llvm::FixedVectorType::get(
--                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::VectorType>(addressType)->getNumElements()));
-+                LLVMTypes::Int64Type, llvm::dyn_cast<llvm::FixedVectorType>(addressType)->getNumElements()));
- #else
-             llvm::UndefValue::get(llvm::VectorType::get(LLVMTypes::Int64Type, addressType->getVectorNumElements()));
- #endif
-@@ -6542,7 +6555,8 @@ llvm::Instruction *FixAddressSpace::processVectorLoad(llvm::LoadInst *LI) {
-         isPtrLoad = true;
-         auto scalarType = g->target->is32Bit() ? LLVMTypes::Int32Type : LLVMTypes::Int64Type;
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--        retType = llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::VectorType>(retType)->getNumElements());
-+        retType =
-+            llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::FixedVectorType>(retType)->getNumElements());
- #else
-         retType = llvm::VectorType::get(scalarType, retType->getVectorNumElements());
- #endif
-@@ -6604,7 +6618,8 @@ llvm::Instruction *FixAddressSpace::processVectorStore(llvm::StoreInst *SI) {
-     if (valType->getScalarType()->isPointerTy()) {
-         auto scalarType = g->target->is32Bit() ? LLVMTypes::Int32Type : LLVMTypes::Int64Type;
- #if ISPC_LLVM_VERSION >= ISPC_LLVM_11_0
--        valType = llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::VectorType>(valType)->getNumElements());
-+        valType =
-+            llvm::FixedVectorType::get(scalarType, llvm::dyn_cast<llvm::FixedVectorType>(valType)->getNumElements());
- #else
-         valType = llvm::VectorType::get(scalarType, valType->getVectorNumElements());
- #endif
diff --git a/srcpkgs/ispc/patches/llvm12-009.patch b/srcpkgs/ispc/patches/llvm12-009.patch
deleted file mode 100644
index d3ea67828582..000000000000
--- a/srcpkgs/ispc/patches/llvm12-009.patch
+++ /dev/null
@@ -1,2109 +0,0 @@
-From 97b13c32132e2704a5e3e7b2eae49d854d087e3e Mon Sep 17 00:00:00 2001
-From: Arina Neshlyaeva <arina.neshlyaeva@intel.com>
-Date: Tue, 4 May 2021 11:31:55 -0700
-Subject: [PATCH] Updated builtins-cm* for switch to LLVM12
-
----
- builtins/builtins-cm-32.ll | 234 ++++++++++++++++++-------------------
- builtins/builtins-cm-64.ll | 232 ++++++++++++++++++------------------
- 2 files changed, 233 insertions(+), 233 deletions(-)
-
-diff --git a/builtins/builtins-cm-32.ll b/builtins/builtins-cm-32.ll
-index 32debf32e..481bbdc48 100644
---- a/builtins/builtins-cm-32.ll
-+++ b/builtins/builtins-cm-32.ll
-@@ -557,7 +557,7 @@ $_ZN13VaryingWriter12WriteVecElemIPvEEvv = comdat any
- @.str.10 = private unnamed_addr constant [5 x i8] c"%08X\00", align 1
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i8 @_Z24__cm_intrinsic_impl_sdivcc(i8 signext, i8 signext) #0 {
-+define internal signext i8 @_Z24__cm_intrinsic_impl_sdivcc(i8 signext, i8 signext) #0 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -618,7 +618,7 @@ define internal <1 x i8> @_ZN7details13__impl_divremILi1EEEu2CMvbT__cS1_S1_u2CMv
- declare <1 x i8> @llvm.genx.rdregioni.v1i8.v1i8.i16(<1 x i8>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -634,7 +634,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -680,7 +680,7 @@ define internal <2 x i8> @_ZN7details13__impl_divremILi2EEEu2CMvbT__cS1_S1_u2CMv
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -818,7 +818,7 @@ define internal <16 x i8> @_ZN7details13__impl_divremILi16EEEu2CMvbT__cS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -864,7 +864,7 @@ define internal <32 x i8> @_ZN7details13__impl_divremILi32EEEu2CMvbT__cS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signext) #0 {
-+define internal signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signext) #0 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -890,7 +890,7 @@ define dso_local signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signe
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -904,7 +904,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -918,7 +918,7 @@ define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -932,7 +932,7 @@ define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8 x i8>) #7 {
-+define internal <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8 x i8>) #7 {
-   %3 = alloca <8 x i8>, align 8
-   %4 = alloca <8 x i8>, align 8
-   %5 = alloca <8 x i8>, align 8
-@@ -946,7 +946,7 @@ define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>, <16 x i8>) #9 {
-+define internal <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>, <16 x i8>) #9 {
-   %3 = alloca <16 x i8>, align 16
-   %4 = alloca <16 x i8>, align 16
-   %5 = alloca <16 x i8>, align 16
-@@ -960,7 +960,7 @@ define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -974,7 +974,7 @@ define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i16 @_Z24__cm_intrinsic_impl_sdivss(i16 signext, i16 signext) #3 {
-+define internal signext i16 @_Z24__cm_intrinsic_impl_sdivss(i16 signext, i16 signext) #3 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1058,7 +1058,7 @@ define internal <1 x i16> @_ZN7details13__impl_divremILi1EEEu2CMvbT__sS1_S1_u2CM
- declare <1 x i16> @llvm.genx.rdregioni.v1i16.v1i16.i16(<1 x i16>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1074,7 +1074,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -1143,7 +1143,7 @@ define internal <2 x i16> @_ZN7details13__impl_divremILi2EEEu2CMvbT__sS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -1350,7 +1350,7 @@ define internal <16 x i16> @_ZN7details13__impl_divremILi16EEEu2CMvbT__sS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -1419,7 +1419,7 @@ define internal <32 x i16> @_ZN7details13__impl_divremILi32EEEu2CMvbT__sS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 signext) #3 {
-+define internal signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 signext) #3 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1445,7 +1445,7 @@ define dso_local signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 si
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1459,7 +1459,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -1473,7 +1473,7 @@ define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -1487,7 +1487,7 @@ define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <8 x i16>) #9 {
-+define internal <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <8 x i16>) #9 {
-   %3 = alloca <8 x i16>, align 16
-   %4 = alloca <8 x i16>, align 16
-   %5 = alloca <8 x i16>, align 16
-@@ -1501,7 +1501,7 @@ define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>, <16 x i16>) #11 {
-+define internal <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>, <16 x i16>) #11 {
-   %3 = alloca <16 x i16>, align 32
-   %4 = alloca <16 x i16>, align 32
-   %5 = alloca <16 x i16>, align 32
-@@ -1515,7 +1515,7 @@ define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -1529,7 +1529,7 @@ define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_sdivii(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_sdivii(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -1730,7 +1730,7 @@ define internal <1 x i32> @_ZN7details13__impl_divremILi1EEEu2CMvbT__iS1_S1_u2CM
- declare <1 x i32> @llvm.genx.rdregioni.v1i32.v1i32.i16(<1 x i32>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -1746,7 +1746,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -1932,7 +1932,7 @@ define internal <2 x i32> @_ZN7details13__impl_divremILi2EEEu2CMvbT__iS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -2490,7 +2490,7 @@ define internal <16 x i32> @_ZN7details13__impl_divremILi16EEEu2CMvbT__iS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -2676,7 +2676,7 @@ define internal <32 x i32> @_ZN7details13__impl_divremILi32EEEu2CMvbT__iS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -2702,7 +2702,7 @@ define dso_local i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -2716,7 +2716,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -2730,7 +2730,7 @@ define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -2744,7 +2744,7 @@ define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <8 x i32>) #17 {
-+define internal <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <8 x i32>) #17 {
-   %3 = alloca <8 x i32>, align 32
-   %4 = alloca <8 x i32>, align 32
-   %5 = alloca <8 x i32>, align 32
-@@ -2758,7 +2758,7 @@ define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>, <16 x i32>) #18 {
-+define internal <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>, <16 x i32>) #18 {
-   %3 = alloca <16 x i32>, align 64
-   %4 = alloca <16 x i32>, align 64
-   %5 = alloca <16 x i32>, align 64
-@@ -2772,7 +2772,7 @@ define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -2786,7 +2786,7 @@ define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_udivhh(i8 zeroext, i8 zeroext) #21 {
-+define internal zeroext i8 @_Z24__cm_intrinsic_impl_udivhh(i8 zeroext, i8 zeroext) #21 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -2844,7 +2844,7 @@ define internal <1 x i8> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__hS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -2860,7 +2860,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -2906,7 +2906,7 @@ define internal <2 x i8> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__hS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -3044,7 +3044,7 @@ define internal <16 x i8> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__hS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -3090,7 +3090,7 @@ define internal <32 x i8> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__hS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroext) #21 {
-+define internal zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroext) #21 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -3116,7 +3116,7 @@ define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroe
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -3130,7 +3130,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -3144,7 +3144,7 @@ define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -3158,7 +3158,7 @@ define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8 x i8>) #15 {
-+define internal <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8 x i8>) #15 {
-   %3 = alloca <8 x i8>, align 8
-   %4 = alloca <8 x i8>, align 8
-   %5 = alloca <8 x i8>, align 8
-@@ -3172,7 +3172,7 @@ define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>, <16 x i8>) #16 {
-+define internal <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>, <16 x i8>) #16 {
-   %3 = alloca <16 x i8>, align 16
-   %4 = alloca <16 x i8>, align 16
-   %5 = alloca <16 x i8>, align 16
-@@ -3186,7 +3186,7 @@ define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -3200,7 +3200,7 @@ define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_udivtt(i16 zeroext, i16 zeroext) #22 {
-+define internal zeroext i16 @_Z24__cm_intrinsic_impl_udivtt(i16 zeroext, i16 zeroext) #22 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3278,7 +3278,7 @@ define internal <1 x i16> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__tS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3294,7 +3294,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -3360,7 +3360,7 @@ define internal <2 x i16> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__tS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -3558,7 +3558,7 @@ define internal <16 x i16> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__tS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -3624,7 +3624,7 @@ define internal <32 x i16> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__tS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 zeroext) #22 {
-+define internal zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 zeroext) #22 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3650,7 +3650,7 @@ define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 ze
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3664,7 +3664,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -3678,7 +3678,7 @@ define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -3692,7 +3692,7 @@ define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <8 x i16>) #16 {
-+define internal <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <8 x i16>) #16 {
-   %3 = alloca <8 x i16>, align 16
-   %4 = alloca <8 x i16>, align 16
-   %5 = alloca <8 x i16>, align 16
-@@ -3706,7 +3706,7 @@ define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>, <16 x i16>) #17 {
-+define internal <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>, <16 x i16>) #17 {
-   %3 = alloca <16 x i16>, align 32
-   %4 = alloca <16 x i16>, align 32
-   %5 = alloca <16 x i16>, align 32
-@@ -3720,7 +3720,7 @@ define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -3734,7 +3734,7 @@ define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_udivjj(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_udivjj(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -3892,7 +3892,7 @@ define internal <1 x i32> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__jS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -3908,7 +3908,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -4054,7 +4054,7 @@ define internal <2 x i32> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__jS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -4492,7 +4492,7 @@ define internal <16 x i32> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__jS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -4638,7 +4638,7 @@ define internal <32 x i32> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__jS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -4664,7 +4664,7 @@ define dso_local i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -4678,7 +4678,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -4692,7 +4692,7 @@ define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -4706,7 +4706,7 @@ define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <8 x i32>) #17 {
-+define internal <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <8 x i32>) #17 {
-   %3 = alloca <8 x i32>, align 32
-   %4 = alloca <8 x i32>, align 32
-   %5 = alloca <8 x i32>, align 32
-@@ -4720,7 +4720,7 @@ define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>, <16 x i32>) #18 {
-+define internal <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>, <16 x i32>) #18 {
-   %3 = alloca <16 x i32>, align 64
-   %4 = alloca <16 x i32>, align 64
-   %5 = alloca <16 x i32>, align 64
-@@ -4734,7 +4734,7 @@ define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -4748,7 +4748,7 @@ define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local void @__do_print_cm(i8*, i8*, i32, i64, i32*, i32, i32) #23 !dbg !15 {
-+define internal void @__do_print_cm(i8*, i8*, i32, i64, i32*, i32, i32) #23 !dbg !15 {
-   %8 = alloca i8*, align 4
-   %9 = alloca i8*, align 4
-   %10 = alloca i32, align 4
-@@ -4988,7 +4988,7 @@ define internal void @_ZN7details16_cm_print_formatILi128EEEv15cm_surfaceindexju
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local void @__do_print_lz(i32, i8*, i32, i64, i32*, i32, i32, i32, i32) #26 !dbg !117 {
-+define internal void @__do_print_lz(i32, i8*, i32, i64, i32*, i32, i32, i32, i32) #26 !dbg !117 {
-   %10 = alloca i32, align 4
-   %11 = alloca i8*, align 4
-   %12 = alloca i32, align 4
-@@ -5069,7 +5069,7 @@ define dso_local void @__do_print_lz(i32, i8*, i32, i64, i32*, i32, i32, i32, i3
-   %67 = load i64, i64* %13, align 8, !dbg !159, !tbaa !19
-   %68 = load <5 x i32>, <5 x i32>* %21, align 32, !dbg !160, !tbaa !7
-   call void @_ZN13VaryingWriterC2ERjRPKjiyu2CMvb5_i(%class.VaryingWriter* %23, i32* dereferenceable(4) %19, i32** dereferenceable(4) %14, i32 %66, i64 %67, <5 x i32> %68), !dbg !161
--  %69 = call zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext %62, %class.UniformWriter* byval align 32 %22, %class.VaryingWriter* byval align 32 %23), !dbg !162
-+  %69 = call zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext %62, %class.UniformWriter* byval(%class.UniformWriter) align 32 %22, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %23), !dbg !162
-   br label %70, !dbg !163
- 
- ; <label>:70:                                     ; preds = %60
-@@ -5187,7 +5187,7 @@ define internal <5 x i32> @_Z17get_auxiliary_strv() #28 comdat !dbg !178 {
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval align 32, %class.VaryingWriter* byval align 32) #25 comdat !dbg !191 {
-+define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %class.VaryingWriter* byval(%class.VaryingWriter) align 32) #25 comdat !dbg !191 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.UniformWriter, align 32
-   %6 = alloca %class.VaryingWriter, align 32
-@@ -5196,7 +5196,7 @@ define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13Varyi
-   %8 = bitcast %class.UniformWriter* %5 to i8*, !dbg !196
-   %9 = bitcast %class.UniformWriter* %1 to i8*, !dbg !196
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %8, i8* align 32 %9, i32 64, i1 false), !dbg !196, !tbaa.struct !197
--  %10 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext %7, %class.UniformWriter* byval align 32 %5), !dbg !198
-+  %10 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext %7, %class.UniformWriter* byval(%class.UniformWriter) align 32 %5), !dbg !198
-   br i1 %10, label %16, label %11, !dbg !199
- 
- ; <label>:11:                                     ; preds = %3
-@@ -5204,7 +5204,7 @@ define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13Varyi
-   %13 = bitcast %class.VaryingWriter* %6 to i8*, !dbg !201
-   %14 = bitcast %class.VaryingWriter* %2 to i8*, !dbg !201
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %13, i8* align 32 %14, i32 64, i1 false), !dbg !201, !tbaa.struct !197
--  %15 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext %12, %class.VaryingWriter* byval align 32 %6), !dbg !202
-+  %15 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext %12, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %6), !dbg !202
-   br label %16, !dbg !199
- 
- ; <label>:16:                                     ; preds = %11, %3
-@@ -5279,7 +5279,7 @@ define internal void @_ZN13VaryingWriterC2ERjRPKjiyu2CMvb5_i(%class.VaryingWrite
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @__num_cores() #29 !dbg !236 {
-+define internal i32 @__num_cores() #29 !dbg !236 {
-   ret i32 -1, !dbg !237
- }
- 
-@@ -8860,7 +8860,7 @@ declare dso_local void @_ZN7details37__cm_intrinsic_impl_svm_scatter_writeIiLi1E
- declare void @llvm.genx.svm.scatter.v1i1.v1i64.v1i32(<1 x i1>, i32, <1 x i64>, <1 x i32>) #27
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext, %class.UniformWriter* byval align 32) #25 comdat !dbg !1645 {
-+define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32) #25 comdat !dbg !1645 {
-   %3 = alloca i8, align 1
-   %4 = alloca %class.UniformWriter, align 32
-   %5 = alloca %"struct.PrintInfo::Encoding4Uniform", align 1
-@@ -8869,7 +8869,7 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWrite
-   %7 = bitcast %class.UniformWriter* %4 to i8*, !dbg !1647
-   %8 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1647
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %7, i8* align 32 %8, i32 64, i1 false), !dbg !1647, !tbaa.struct !197
--  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext %6, %class.UniformWriter* byval align 32 %4, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %5), !dbg !1648
-+  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext %6, %class.UniformWriter* byval(%class.UniformWriter) align 32 %4, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %5), !dbg !1648
-   ret i1 %9, !dbg !1649
- }
- 
-@@ -8877,7 +8877,7 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWrite
- declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1) #32
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext, %class.VaryingWriter* byval align 32) #25 comdat !dbg !1650 {
-+define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32) #25 comdat !dbg !1650 {
-   %3 = alloca i8, align 1
-   %4 = alloca %class.VaryingWriter, align 32
-   %5 = alloca %"struct.PrintInfo::Encoding4Varying", align 1
-@@ -8886,12 +8886,12 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWrite
-   %7 = bitcast %class.VaryingWriter* %4 to i8*, !dbg !1652
-   %8 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !1652
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %7, i8* align 32 %8, i32 64, i1 false), !dbg !1652, !tbaa.struct !197
--  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext %6, %class.VaryingWriter* byval align 32 %4, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %5), !dbg !1653
-+  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext %6, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %4, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %5), !dbg !1653
-   ret i1 %9, !dbg !1654
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1655 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1655 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.UniformWriter, align 32
-   %6 = alloca %"struct.PrintInfo::Encoding4Uniform", align 1
-@@ -8914,7 +8914,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %22 = bitcast %class.UniformWriter* %5 to i8*, !dbg !1657
-   %23 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1657
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %22, i8* align 32 %23, i32 64, i1 false), !dbg !1657, !tbaa.struct !197
--  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.UniformWriter* byval align 32 %5, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %6), !dbg !1658
-+  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.UniformWriter* byval(%class.UniformWriter) align 32 %5, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %6), !dbg !1658
-   br i1 %24, label %60, label %25, !dbg !1659
- 
- ; <label>:25:                                     ; preds = %3
-@@ -8922,7 +8922,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %27 = bitcast %class.UniformWriter* %7 to i8*, !dbg !1661
-   %28 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1661
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %27, i8* align 32 %28, i32 64, i1 false), !dbg !1661, !tbaa.struct !197
--  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.UniformWriter* byval align 32 %7, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %8), !dbg !1662
-+  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.UniformWriter* byval(%class.UniformWriter) align 32 %7, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %8), !dbg !1662
-   br i1 %29, label %60, label %30, !dbg !1663
- 
- ; <label>:30:                                     ; preds = %25
-@@ -8930,7 +8930,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %32 = bitcast %class.UniformWriter* %9 to i8*, !dbg !1665
-   %33 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1665
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %32, i8* align 32 %33, i32 64, i1 false), !dbg !1665, !tbaa.struct !197
--  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.UniformWriter* byval align 32 %9, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %10), !dbg !1666
-+  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.UniformWriter* byval(%class.UniformWriter) align 32 %9, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %10), !dbg !1666
-   br i1 %34, label %60, label %35, !dbg !1667
- 
- ; <label>:35:                                     ; preds = %30
-@@ -8938,7 +8938,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %37 = bitcast %class.UniformWriter* %11 to i8*, !dbg !1669
-   %38 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1669
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %37, i8* align 32 %38, i32 64, i1 false), !dbg !1669, !tbaa.struct !197
--  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.UniformWriter* byval align 32 %11, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %12), !dbg !1670
-+  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.UniformWriter* byval(%class.UniformWriter) align 32 %11, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %12), !dbg !1670
-   br i1 %39, label %60, label %40, !dbg !1671
- 
- ; <label>:40:                                     ; preds = %35
-@@ -8946,7 +8946,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %42 = bitcast %class.UniformWriter* %13 to i8*, !dbg !1673
-   %43 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1673
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %42, i8* align 32 %43, i32 64, i1 false), !dbg !1673, !tbaa.struct !197
--  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.UniformWriter* byval align 32 %13, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %14), !dbg !1674
-+  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.UniformWriter* byval(%class.UniformWriter) align 32 %13, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %14), !dbg !1674
-   br i1 %44, label %60, label %45, !dbg !1675
- 
- ; <label>:45:                                     ; preds = %40
-@@ -8954,7 +8954,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %47 = bitcast %class.UniformWriter* %15 to i8*, !dbg !1677
-   %48 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1677
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %47, i8* align 32 %48, i32 64, i1 false), !dbg !1677, !tbaa.struct !197
--  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.UniformWriter* byval align 32 %15, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %16), !dbg !1678
-+  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.UniformWriter* byval(%class.UniformWriter) align 32 %15, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %16), !dbg !1678
-   br i1 %49, label %60, label %50, !dbg !1679
- 
- ; <label>:50:                                     ; preds = %45
-@@ -8962,7 +8962,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %52 = bitcast %class.UniformWriter* %17 to i8*, !dbg !1681
-   %53 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1681
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %52, i8* align 32 %53, i32 64, i1 false), !dbg !1681, !tbaa.struct !197
--  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.UniformWriter* byval align 32 %17, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %18), !dbg !1682
-+  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.UniformWriter* byval(%class.UniformWriter) align 32 %17, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %18), !dbg !1682
-   br i1 %54, label %60, label %55, !dbg !1683
- 
- ; <label>:55:                                     ; preds = %50
-@@ -8970,7 +8970,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %57 = bitcast %class.UniformWriter* %19 to i8*, !dbg !1685
-   %58 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1685
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %57, i8* align 32 %58, i32 64, i1 false), !dbg !1685, !tbaa.struct !197
--  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.UniformWriter* byval align 32 %19, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %20), !dbg !1686
-+  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.UniformWriter* byval(%class.UniformWriter) align 32 %19, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %20), !dbg !1686
-   br label %60, !dbg !1683
- 
- ; <label>:60:                                     ; preds = %55, %50, %45, %40, %35, %30, %25, %3
-@@ -8979,7 +8979,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1688 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1688 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9005,7 +9005,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1697 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1697 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9031,7 +9031,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1706 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1706 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9057,7 +9057,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1715 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1715 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9083,7 +9083,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1724 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1724 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9109,7 +9109,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1733 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1733 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9135,7 +9135,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1742 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1742 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9161,7 +9161,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1751 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1751 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9984,7 +9984,7 @@ define internal i32 @_ZN7details18_cm_print_type_oclIPvEENS_18SHADER_PRINTF_TYPE
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2055 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2055 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.VaryingWriter, align 32
-   %6 = alloca %"struct.PrintInfo::Encoding4Varying", align 1
-@@ -10007,7 +10007,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %22 = bitcast %class.VaryingWriter* %5 to i8*, !dbg !2057
-   %23 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2057
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %22, i8* align 32 %23, i32 64, i1 false), !dbg !2057, !tbaa.struct !197
--  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.VaryingWriter* byval align 32 %5, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %6), !dbg !2058
-+  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %5, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %6), !dbg !2058
-   br i1 %24, label %60, label %25, !dbg !2059
- 
- ; <label>:25:                                     ; preds = %3
-@@ -10015,7 +10015,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %27 = bitcast %class.VaryingWriter* %7 to i8*, !dbg !2061
-   %28 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2061
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %27, i8* align 32 %28, i32 64, i1 false), !dbg !2061, !tbaa.struct !197
--  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.VaryingWriter* byval align 32 %7, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %8), !dbg !2062
-+  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %7, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %8), !dbg !2062
-   br i1 %29, label %60, label %30, !dbg !2063
- 
- ; <label>:30:                                     ; preds = %25
-@@ -10023,7 +10023,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %32 = bitcast %class.VaryingWriter* %9 to i8*, !dbg !2065
-   %33 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2065
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %32, i8* align 32 %33, i32 64, i1 false), !dbg !2065, !tbaa.struct !197
--  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.VaryingWriter* byval align 32 %9, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %10), !dbg !2066
-+  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %9, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %10), !dbg !2066
-   br i1 %34, label %60, label %35, !dbg !2067
- 
- ; <label>:35:                                     ; preds = %30
-@@ -10031,7 +10031,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %37 = bitcast %class.VaryingWriter* %11 to i8*, !dbg !2069
-   %38 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2069
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %37, i8* align 32 %38, i32 64, i1 false), !dbg !2069, !tbaa.struct !197
--  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.VaryingWriter* byval align 32 %11, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %12), !dbg !2070
-+  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %11, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %12), !dbg !2070
-   br i1 %39, label %60, label %40, !dbg !2071
- 
- ; <label>:40:                                     ; preds = %35
-@@ -10039,7 +10039,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %42 = bitcast %class.VaryingWriter* %13 to i8*, !dbg !2073
-   %43 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2073
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %42, i8* align 32 %43, i32 64, i1 false), !dbg !2073, !tbaa.struct !197
--  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.VaryingWriter* byval align 32 %13, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %14), !dbg !2074
-+  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %13, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %14), !dbg !2074
-   br i1 %44, label %60, label %45, !dbg !2075
- 
- ; <label>:45:                                     ; preds = %40
-@@ -10047,7 +10047,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %47 = bitcast %class.VaryingWriter* %15 to i8*, !dbg !2077
-   %48 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2077
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %47, i8* align 32 %48, i32 64, i1 false), !dbg !2077, !tbaa.struct !197
--  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.VaryingWriter* byval align 32 %15, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %16), !dbg !2078
-+  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %15, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %16), !dbg !2078
-   br i1 %49, label %60, label %50, !dbg !2079
- 
- ; <label>:50:                                     ; preds = %45
-@@ -10055,7 +10055,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %52 = bitcast %class.VaryingWriter* %17 to i8*, !dbg !2081
-   %53 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2081
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %52, i8* align 32 %53, i32 64, i1 false), !dbg !2081, !tbaa.struct !197
--  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.VaryingWriter* byval align 32 %17, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %18), !dbg !2082
-+  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %17, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %18), !dbg !2082
-   br i1 %54, label %60, label %55, !dbg !2083
- 
- ; <label>:55:                                     ; preds = %50
-@@ -10063,7 +10063,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %57 = bitcast %class.VaryingWriter* %19 to i8*, !dbg !2085
-   %58 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2085
-   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 32 %57, i8* align 32 %58, i32 64, i1 false), !dbg !2085, !tbaa.struct !197
--  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.VaryingWriter* byval align 32 %19, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %20), !dbg !2086
-+  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %19, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %20), !dbg !2086
-   br label %60, !dbg !2083
- 
- ; <label>:60:                                     ; preds = %55, %50, %45, %40, %35, %30, %25, %3
-@@ -10072,7 +10072,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2088 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2088 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10098,7 +10098,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2097 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2097 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10124,7 +10124,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2106 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2106 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10150,7 +10150,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2115 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2115 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10176,7 +10176,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2124 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2124 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10202,7 +10202,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2133 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2133 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10228,7 +10228,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2142 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2142 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10254,7 +10254,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2151 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2151 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-diff --git a/builtins/builtins-cm-64.ll b/builtins/builtins-cm-64.ll
-index 39a2dd8be..375d01bed 100644
---- a/builtins/builtins-cm-64.ll
-+++ b/builtins/builtins-cm-64.ll
-@@ -557,7 +557,7 @@ $_ZN13VaryingWriter12WriteVecElemIPvEEvv = comdat any
- @.str.10 = private unnamed_addr constant [8 x i8] c"%016llX\00", align 1
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i8 @_Z24__cm_intrinsic_impl_sdivcc(i8 signext, i8 signext) #0 {
-+define internal signext i8 @_Z24__cm_intrinsic_impl_sdivcc(i8 signext, i8 signext) #0 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -618,7 +618,7 @@ define internal <1 x i8> @_ZN7details13__impl_divremILi1EEEu2CMvbT__cS1_S1_u2CMv
- declare <1 x i8> @llvm.genx.rdregioni.v1i8.v1i8.i16(<1 x i8>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -634,7 +634,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_cS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -680,7 +680,7 @@ define internal <2 x i8> @_ZN7details13__impl_divremILi2EEEu2CMvbT__cS1_S1_u2CMv
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -818,7 +818,7 @@ define internal <16 x i8> @_ZN7details13__impl_divremILi16EEEu2CMvbT__cS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -864,7 +864,7 @@ define internal <32 x i8> @_ZN7details13__impl_divremILi32EEEu2CMvbT__cS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signext) #0 {
-+define internal signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signext) #0 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -890,7 +890,7 @@ define dso_local signext i8 @_Z24__cm_intrinsic_impl_sremcc(i8 signext, i8 signe
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1 x i8>) #0 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -904,7 +904,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb1_cS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2 x i8>) #3 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -918,7 +918,7 @@ define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb2_cS_(<2 x i8>, <2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4 x i8>) #5 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -932,7 +932,7 @@ define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb4_cS_(<4 x i8>, <4
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8 x i8>) #7 {
-+define internal <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8 x i8>) #7 {
-   %3 = alloca <8 x i8>, align 8
-   %4 = alloca <8 x i8>, align 8
-   %5 = alloca <8 x i8>, align 8
-@@ -946,7 +946,7 @@ define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb8_cS_(<8 x i8>, <8
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>, <16 x i8>) #9 {
-+define internal <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>, <16 x i8>) #9 {
-   %3 = alloca <16 x i8>, align 16
-   %4 = alloca <16 x i8>, align 16
-   %5 = alloca <16 x i8>, align 16
-@@ -960,7 +960,7 @@ define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb16_cS_(<16 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>, <32 x i8>) #11 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -974,7 +974,7 @@ define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_sremu2CMvb32_cS_(<32 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i16 @_Z24__cm_intrinsic_impl_sdivss(i16 signext, i16 signext) #3 {
-+define internal signext i16 @_Z24__cm_intrinsic_impl_sdivss(i16 signext, i16 signext) #3 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1058,7 +1058,7 @@ define internal <1 x i16> @_ZN7details13__impl_divremILi1EEEu2CMvbT__sS1_S1_u2CM
- declare <1 x i16> @llvm.genx.rdregioni.v1i16.v1i16.i16(<1 x i16>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1074,7 +1074,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_sS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -1143,7 +1143,7 @@ define internal <2 x i16> @_ZN7details13__impl_divremILi2EEEu2CMvbT__sS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -1350,7 +1350,7 @@ define internal <16 x i16> @_ZN7details13__impl_divremILi16EEEu2CMvbT__sS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -1419,7 +1419,7 @@ define internal <32 x i16> @_ZN7details13__impl_divremILi32EEEu2CMvbT__sS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 signext) #3 {
-+define internal signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 signext) #3 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1445,7 +1445,7 @@ define dso_local signext i16 @_Z24__cm_intrinsic_impl_sremss(i16 signext, i16 si
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <1 x i16>) #3 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -1459,7 +1459,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb1_sS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <2 x i16>) #5 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -1473,7 +1473,7 @@ define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb2_sS_(<2 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <4 x i16>) #7 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -1487,7 +1487,7 @@ define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb4_sS_(<4 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <8 x i16>) #9 {
-+define internal <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <8 x i16>) #9 {
-   %3 = alloca <8 x i16>, align 16
-   %4 = alloca <8 x i16>, align 16
-   %5 = alloca <8 x i16>, align 16
-@@ -1501,7 +1501,7 @@ define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb8_sS_(<8 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>, <16 x i16>) #11 {
-+define internal <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>, <16 x i16>) #11 {
-   %3 = alloca <16 x i16>, align 32
-   %4 = alloca <16 x i16>, align 32
-   %5 = alloca <16 x i16>, align 32
-@@ -1515,7 +1515,7 @@ define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb16_sS_(<16 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>, <32 x i16>) #13 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -1529,7 +1529,7 @@ define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_sremu2CMvb32_sS_(<32 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_sdivii(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_sdivii(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -1730,7 +1730,7 @@ define internal <1 x i32> @_ZN7details13__impl_divremILi1EEEu2CMvbT__iS1_S1_u2CM
- declare <1 x i32> @llvm.genx.rdregioni.v1i32.v1i32.i16(<1 x i32>, i32, i32, i32, i16, i32) #2
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -1746,7 +1746,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb1_iS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -1932,7 +1932,7 @@ define internal <2 x i32> @_ZN7details13__impl_divremILi2EEEu2CMvbT__iS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -2490,7 +2490,7 @@ define internal <16 x i32> @_ZN7details13__impl_divremILi16EEEu2CMvbT__iS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_sdivu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -2676,7 +2676,7 @@ define internal <32 x i32> @_ZN7details13__impl_divremILi32EEEu2CMvbT__iS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -2702,7 +2702,7 @@ define dso_local i32 @_Z24__cm_intrinsic_impl_sremii(i32, i32) #14 {
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -2716,7 +2716,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb1_iS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -2730,7 +2730,7 @@ define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb2_iS_(<2 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -2744,7 +2744,7 @@ define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb4_iS_(<4 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <8 x i32>) #17 {
-+define internal <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <8 x i32>) #17 {
-   %3 = alloca <8 x i32>, align 32
-   %4 = alloca <8 x i32>, align 32
-   %5 = alloca <8 x i32>, align 32
-@@ -2758,7 +2758,7 @@ define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb8_iS_(<8 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>, <16 x i32>) #18 {
-+define internal <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>, <16 x i32>) #18 {
-   %3 = alloca <16 x i32>, align 64
-   %4 = alloca <16 x i32>, align 64
-   %5 = alloca <16 x i32>, align 64
-@@ -2772,7 +2772,7 @@ define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb16_iS_(<16 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -2786,7 +2786,7 @@ define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_sremu2CMvb32_iS_(<32 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_udivhh(i8 zeroext, i8 zeroext) #21 {
-+define internal zeroext i8 @_Z24__cm_intrinsic_impl_udivhh(i8 zeroext, i8 zeroext) #21 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -2844,7 +2844,7 @@ define internal <1 x i8> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__hS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -2860,7 +2860,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb1_hS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -2906,7 +2906,7 @@ define internal <2 x i8> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__hS1_S1_u2CM
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -3044,7 +3044,7 @@ define internal <16 x i8> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__hS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_udivu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -3090,7 +3090,7 @@ define internal <32 x i8> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__hS1_S1_u2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroext) #21 {
-+define internal zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroext) #21 {
-   %3 = alloca i8, align 1
-   %4 = alloca i8, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -3116,7 +3116,7 @@ define dso_local zeroext i8 @_Z24__cm_intrinsic_impl_uremhh(i8 zeroext, i8 zeroe
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-+define internal <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1 x i8>) #21 {
-   %3 = alloca <1 x i8>, align 1
-   %4 = alloca <1 x i8>, align 1
-   %5 = alloca <1 x i8>, align 1
-@@ -3130,7 +3130,7 @@ define dso_local <1 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb1_hS_(<1 x i8>, <1
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-+define internal <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2 x i8>) #22 {
-   %3 = alloca <2 x i8>, align 2
-   %4 = alloca <2 x i8>, align 2
-   %5 = alloca <2 x i8>, align 2
-@@ -3144,7 +3144,7 @@ define dso_local <2 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb2_hS_(<2 x i8>, <2
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-+define internal <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4 x i8>) #14 {
-   %3 = alloca <4 x i8>, align 4
-   %4 = alloca <4 x i8>, align 4
-   %5 = alloca <4 x i8>, align 4
-@@ -3158,7 +3158,7 @@ define dso_local <4 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb4_hS_(<4 x i8>, <4
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8 x i8>) #15 {
-+define internal <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8 x i8>) #15 {
-   %3 = alloca <8 x i8>, align 8
-   %4 = alloca <8 x i8>, align 8
-   %5 = alloca <8 x i8>, align 8
-@@ -3172,7 +3172,7 @@ define dso_local <8 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb8_hS_(<8 x i8>, <8
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>, <16 x i8>) #16 {
-+define internal <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>, <16 x i8>) #16 {
-   %3 = alloca <16 x i8>, align 16
-   %4 = alloca <16 x i8>, align 16
-   %5 = alloca <16 x i8>, align 16
-@@ -3186,7 +3186,7 @@ define dso_local <16 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb16_hS_(<16 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-+define internal <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>, <32 x i8>) #17 {
-   %3 = alloca <32 x i8>, align 32
-   %4 = alloca <32 x i8>, align 32
-   %5 = alloca <32 x i8>, align 32
-@@ -3200,7 +3200,7 @@ define dso_local <32 x i8> @_Z24__cm_intrinsic_impl_uremu2CMvb32_hS_(<32 x i8>,
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_udivtt(i16 zeroext, i16 zeroext) #22 {
-+define internal zeroext i16 @_Z24__cm_intrinsic_impl_udivtt(i16 zeroext, i16 zeroext) #22 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3278,7 +3278,7 @@ define internal <1 x i16> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__tS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3294,7 +3294,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb1_tS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -3360,7 +3360,7 @@ define internal <2 x i16> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__tS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -3558,7 +3558,7 @@ define internal <16 x i16> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__tS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_udivu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -3624,7 +3624,7 @@ define internal <32 x i16> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__tS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 zeroext) #22 {
-+define internal zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 zeroext) #22 {
-   %3 = alloca i16, align 2
-   %4 = alloca i16, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3650,7 +3650,7 @@ define dso_local zeroext i16 @_Z24__cm_intrinsic_impl_uremtt(i16 zeroext, i16 ze
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-+define internal <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <1 x i16>) #22 {
-   %3 = alloca <1 x i16>, align 2
-   %4 = alloca <1 x i16>, align 2
-   %5 = alloca <1 x i16>, align 2
-@@ -3664,7 +3664,7 @@ define dso_local <1 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb1_tS_(<1 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-+define internal <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <2 x i16>) #14 {
-   %3 = alloca <2 x i16>, align 4
-   %4 = alloca <2 x i16>, align 4
-   %5 = alloca <2 x i16>, align 4
-@@ -3678,7 +3678,7 @@ define dso_local <2 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb2_tS_(<2 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-+define internal <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <4 x i16>) #15 {
-   %3 = alloca <4 x i16>, align 8
-   %4 = alloca <4 x i16>, align 8
-   %5 = alloca <4 x i16>, align 8
-@@ -3692,7 +3692,7 @@ define dso_local <4 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb4_tS_(<4 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <8 x i16>) #16 {
-+define internal <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <8 x i16>) #16 {
-   %3 = alloca <8 x i16>, align 16
-   %4 = alloca <8 x i16>, align 16
-   %5 = alloca <8 x i16>, align 16
-@@ -3706,7 +3706,7 @@ define dso_local <8 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb8_tS_(<8 x i16>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>, <16 x i16>) #17 {
-+define internal <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>, <16 x i16>) #17 {
-   %3 = alloca <16 x i16>, align 32
-   %4 = alloca <16 x i16>, align 32
-   %5 = alloca <16 x i16>, align 32
-@@ -3720,7 +3720,7 @@ define dso_local <16 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb16_tS_(<16 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-+define internal <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>, <32 x i16>) #18 {
-   %3 = alloca <32 x i16>, align 64
-   %4 = alloca <32 x i16>, align 64
-   %5 = alloca <32 x i16>, align 64
-@@ -3734,7 +3734,7 @@ define dso_local <32 x i16> @_Z24__cm_intrinsic_impl_uremu2CMvb32_tS_(<32 x i16>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_udivjj(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_udivjj(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -3892,7 +3892,7 @@ define internal <1 x i32> @_ZN7details14__impl_udivremILi1EEEu2CMvbT__jS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -3908,7 +3908,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb1_jS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -4054,7 +4054,7 @@ define internal <2 x i32> @_ZN7details14__impl_udivremILi2EEEu2CMvbT__jS1_S1_u2C
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -4492,7 +4492,7 @@ define internal <16 x i32> @_ZN7details14__impl_udivremILi16EEEu2CMvbT__jS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_udivu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -4638,7 +4638,7 @@ define internal <32 x i32> @_ZN7details14__impl_udivremILi32EEEu2CMvbT__jS1_S1_u
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
-+define internal i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
-   %3 = alloca i32, align 4
-   %4 = alloca i32, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -4664,7 +4664,7 @@ define dso_local i32 @_Z24__cm_intrinsic_impl_uremjj(i32, i32) #14 {
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-+define internal <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <1 x i32>) #14 {
-   %3 = alloca <1 x i32>, align 4
-   %4 = alloca <1 x i32>, align 4
-   %5 = alloca <1 x i32>, align 4
-@@ -4678,7 +4678,7 @@ define dso_local <1 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb1_jS_(<1 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-+define internal <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <2 x i32>) #15 {
-   %3 = alloca <2 x i32>, align 8
-   %4 = alloca <2 x i32>, align 8
-   %5 = alloca <2 x i32>, align 8
-@@ -4692,7 +4692,7 @@ define dso_local <2 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb2_jS_(<2 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-+define internal <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <4 x i32>) #16 {
-   %3 = alloca <4 x i32>, align 16
-   %4 = alloca <4 x i32>, align 16
-   %5 = alloca <4 x i32>, align 16
-@@ -4706,7 +4706,7 @@ define dso_local <4 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb4_jS_(<4 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <8 x i32>) #17 {
-+define internal <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <8 x i32>) #17 {
-   %3 = alloca <8 x i32>, align 32
-   %4 = alloca <8 x i32>, align 32
-   %5 = alloca <8 x i32>, align 32
-@@ -4720,7 +4720,7 @@ define dso_local <8 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb8_jS_(<8 x i32>, <
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>, <16 x i32>) #18 {
-+define internal <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>, <16 x i32>) #18 {
-   %3 = alloca <16 x i32>, align 64
-   %4 = alloca <16 x i32>, align 64
-   %5 = alloca <16 x i32>, align 64
-@@ -4734,7 +4734,7 @@ define dso_local <16 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb16_jS_(<16 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-+define internal <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>, <32 x i32>) #19 {
-   %3 = alloca <32 x i32>, align 128
-   %4 = alloca <32 x i32>, align 128
-   %5 = alloca <32 x i32>, align 128
-@@ -4748,7 +4748,7 @@ define dso_local <32 x i32> @_Z24__cm_intrinsic_impl_uremu2CMvb32_jS_(<32 x i32>
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local void @__do_print_cm(i8*, i8*, i32, i64, i32*, i32, i32) #23 !dbg !15 {
-+define internal void @__do_print_cm(i8*, i8*, i32, i64, i32*, i32, i32) #23 !dbg !15 {
-   %8 = alloca i8*, align 8
-   %9 = alloca i8*, align 8
-   %10 = alloca i32, align 4
-@@ -5070,7 +5070,7 @@ define dso_local void @__do_print_lz(i32, i8*, i32, i64, i32*, i32, i32, i32, i3
-   %67 = load i64, i64* %13, align 8, !dbg !159, !tbaa !19
-   %68 = load <5 x i32>, <5 x i32>* %21, align 32, !dbg !160, !tbaa !7
-   call void @_ZN13VaryingWriterC2ERyRPKjiyu2CMvb5_i(%class.VaryingWriter* %23, i64* dereferenceable(8) %19, i32** dereferenceable(8) %14, i32 %66, i64 %67, <5 x i32> %68), !dbg !161
--  %69 = call zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext %62, %class.UniformWriter* byval align 32 %22, %class.VaryingWriter* byval align 32 %23), !dbg !162
-+  %69 = call zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext %62, %class.UniformWriter* byval(%class.UniformWriter) align 32 %22, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %23), !dbg !162
-   br label %70, !dbg !163
- 
- ; <label>:70:                                     ; preds = %60
-@@ -5188,7 +5188,7 @@ define internal <5 x i32> @_Z17get_auxiliary_strv() #28 comdat !dbg !178 {
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval align 32, %class.VaryingWriter* byval align 32) #25 comdat !dbg !191 {
-+define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13VaryingWriterEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %class.VaryingWriter* byval(%class.VaryingWriter) align 32) #25 comdat !dbg !191 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.UniformWriter, align 32
-   %6 = alloca %class.VaryingWriter, align 32
-@@ -5197,7 +5197,7 @@ define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13Varyi
-   %8 = bitcast %class.UniformWriter* %5 to i8*, !dbg !196
-   %9 = bitcast %class.UniformWriter* %1 to i8*, !dbg !196
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %8, i8* align 32 %9, i64 64, i1 false), !dbg !196, !tbaa.struct !197
--  %10 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext %7, %class.UniformWriter* byval align 32 %5), !dbg !198
-+  %10 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext %7, %class.UniformWriter* byval(%class.UniformWriter) align 32 %5), !dbg !198
-   br i1 %10, label %16, label %11, !dbg !199
- 
- ; <label>:11:                                     ; preds = %3
-@@ -5205,7 +5205,7 @@ define internal zeroext i1 @_ZN9PrintInfo14switchEncodingI13UniformWriter13Varyi
-   %13 = bitcast %class.VaryingWriter* %6 to i8*, !dbg !201
-   %14 = bitcast %class.VaryingWriter* %2 to i8*, !dbg !201
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %13, i8* align 32 %14, i64 64, i1 false), !dbg !201, !tbaa.struct !197
--  %15 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext %12, %class.VaryingWriter* byval align 32 %6), !dbg !202
-+  %15 = call zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext %12, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %6), !dbg !202
-   br label %16, !dbg !199
- 
- ; <label>:16:                                     ; preds = %11, %3
-@@ -5280,7 +5280,7 @@ define internal void @_ZN13VaryingWriterC2ERyRPKjiyu2CMvb5_i(%class.VaryingWrite
- }
- 
- ; Function Attrs: noinline nounwind
--define dso_local i32 @__num_cores() #29 !dbg !236 {
-+define internal i32 @__num_cores() #29 !dbg !236 {
-   ret i32 -1, !dbg !237
- }
- 
-@@ -8870,7 +8870,7 @@ declare dso_local void @_ZN7details37__cm_intrinsic_impl_svm_scatter_writeIiLi1E
- declare void @llvm.genx.svm.scatter.v1i1.v1i64.v1i32(<1 x i1>, i32, <1 x i64>, <1 x i32>) #27
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext, %class.UniformWriter* byval align 32) #25 comdat !dbg !1645 {
-+define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWriterEEbNS_8EncodingET_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32) #25 comdat !dbg !1645 {
-   %3 = alloca i8, align 1
-   %4 = alloca %class.UniformWriter, align 32
-   %5 = alloca %"struct.PrintInfo::Encoding4Uniform", align 1
-@@ -8879,7 +8879,7 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWrite
-   %7 = bitcast %class.UniformWriter* %4 to i8*, !dbg !1647
-   %8 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1647
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %7, i8* align 32 %8, i64 64, i1 false), !dbg !1647, !tbaa.struct !197
--  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext %6, %class.UniformWriter* byval align 32 %4, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %5), !dbg !1648
-+  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext %6, %class.UniformWriter* byval(%class.UniformWriter) align 32 %4, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %5), !dbg !1648
-   ret i1 %9, !dbg !1649
- }
- 
-@@ -8887,7 +8887,7 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4UniformI13UniformWrite
- declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #32
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext, %class.VaryingWriter* byval align 32) #25 comdat !dbg !1650 {
-+define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWriterEEbNS_8EncodingET_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32) #25 comdat !dbg !1650 {
-   %3 = alloca i8, align 1
-   %4 = alloca %class.VaryingWriter, align 32
-   %5 = alloca %"struct.PrintInfo::Encoding4Varying", align 1
-@@ -8896,12 +8896,12 @@ define internal zeroext i1 @_ZN9PrintInfo22switchEncoding4VaryingI13VaryingWrite
-   %7 = bitcast %class.VaryingWriter* %4 to i8*, !dbg !1652
-   %8 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !1652
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %7, i8* align 32 %8, i64 64, i1 false), !dbg !1652, !tbaa.struct !197
--  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext %6, %class.VaryingWriter* byval align 32 %4, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %5), !dbg !1653
-+  %9 = call zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext %6, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %4, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %5), !dbg !1653
-   ret i1 %9, !dbg !1654
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1655 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET_T0_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1655 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.UniformWriter, align 32
-   %6 = alloca %"struct.PrintInfo::Encoding4Uniform", align 1
-@@ -8924,7 +8924,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %22 = bitcast %class.UniformWriter* %5 to i8*, !dbg !1657
-   %23 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1657
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %22, i8* align 32 %23, i64 64, i1 false), !dbg !1657, !tbaa.struct !197
--  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.UniformWriter* byval align 32 %5, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %6), !dbg !1658
-+  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.UniformWriter* byval(%class.UniformWriter) align 32 %5, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %6), !dbg !1658
-   br i1 %24, label %60, label %25, !dbg !1659
- 
- ; <label>:25:                                     ; preds = %3
-@@ -8932,7 +8932,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %27 = bitcast %class.UniformWriter* %7 to i8*, !dbg !1661
-   %28 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1661
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %27, i8* align 32 %28, i64 64, i1 false), !dbg !1661, !tbaa.struct !197
--  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.UniformWriter* byval align 32 %7, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %8), !dbg !1662
-+  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.UniformWriter* byval(%class.UniformWriter) align 32 %7, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %8), !dbg !1662
-   br i1 %29, label %60, label %30, !dbg !1663
- 
- ; <label>:30:                                     ; preds = %25
-@@ -8940,7 +8940,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %32 = bitcast %class.UniformWriter* %9 to i8*, !dbg !1665
-   %33 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1665
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %32, i8* align 32 %33, i64 64, i1 false), !dbg !1665, !tbaa.struct !197
--  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.UniformWriter* byval align 32 %9, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %10), !dbg !1666
-+  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.UniformWriter* byval(%class.UniformWriter) align 32 %9, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %10), !dbg !1666
-   br i1 %34, label %60, label %35, !dbg !1667
- 
- ; <label>:35:                                     ; preds = %30
-@@ -8948,7 +8948,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %37 = bitcast %class.UniformWriter* %11 to i8*, !dbg !1669
-   %38 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1669
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %37, i8* align 32 %38, i64 64, i1 false), !dbg !1669, !tbaa.struct !197
--  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.UniformWriter* byval align 32 %11, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %12), !dbg !1670
-+  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.UniformWriter* byval(%class.UniformWriter) align 32 %11, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %12), !dbg !1670
-   br i1 %39, label %60, label %40, !dbg !1671
- 
- ; <label>:40:                                     ; preds = %35
-@@ -8956,7 +8956,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %42 = bitcast %class.UniformWriter* %13 to i8*, !dbg !1673
-   %43 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1673
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %42, i8* align 32 %43, i64 64, i1 false), !dbg !1673, !tbaa.struct !197
--  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.UniformWriter* byval align 32 %13, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %14), !dbg !1674
-+  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.UniformWriter* byval(%class.UniformWriter) align 32 %13, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %14), !dbg !1674
-   br i1 %44, label %60, label %45, !dbg !1675
- 
- ; <label>:45:                                     ; preds = %40
-@@ -8964,7 +8964,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %47 = bitcast %class.UniformWriter* %15 to i8*, !dbg !1677
-   %48 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1677
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %47, i8* align 32 %48, i64 64, i1 false), !dbg !1677, !tbaa.struct !197
--  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.UniformWriter* byval align 32 %15, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %16), !dbg !1678
-+  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.UniformWriter* byval(%class.UniformWriter) align 32 %15, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %16), !dbg !1678
-   br i1 %49, label %60, label %50, !dbg !1679
- 
- ; <label>:50:                                     ; preds = %45
-@@ -8972,7 +8972,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %52 = bitcast %class.UniformWriter* %17 to i8*, !dbg !1681
-   %53 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1681
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %52, i8* align 32 %53, i64 64, i1 false), !dbg !1681, !tbaa.struct !197
--  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.UniformWriter* byval align 32 %17, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %18), !dbg !1682
-+  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.UniformWriter* byval(%class.UniformWriter) align 32 %17, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %18), !dbg !1682
-   br i1 %54, label %60, label %55, !dbg !1683
- 
- ; <label>:55:                                     ; preds = %50
-@@ -8980,7 +8980,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
-   %57 = bitcast %class.UniformWriter* %19 to i8*, !dbg !1685
-   %58 = bitcast %class.UniformWriter* %1 to i8*, !dbg !1685
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %57, i8* align 32 %58, i64 64, i1 false), !dbg !1685, !tbaa.struct !197
--  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.UniformWriter* byval align 32 %19, %"struct.PrintInfo::Encoding4Uniform"* byval align 1 %20), !dbg !1686
-+  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.UniformWriter* byval(%class.UniformWriter) align 32 %19, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1 %20), !dbg !1686
-   br label %60, !dbg !1683
- 
- ; <label>:60:                                     ; preds = %55, %50, %45, %40, %35, %30, %25, %3
-@@ -8989,7 +8989,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13UniformWriter
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1688 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1688 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9015,7 +9015,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1697 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1697 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9041,7 +9041,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1706 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1706 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9067,7 +9067,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1715 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1715 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9093,7 +9093,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1724 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1724 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9119,7 +9119,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1733 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1733 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9145,7 +9145,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1742 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1742 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -9171,7 +9171,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13Unifo
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval align 32, %"struct.PrintInfo::Encoding4Uniform"* byval align 1) #25 comdat !dbg !1751 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13UniformWriterNS_16Encoding4UniformEEEbNS_8EncodingET0_T1_(i8 signext, %class.UniformWriter* byval(%class.UniformWriter) align 32, %"struct.PrintInfo::Encoding4Uniform"* byval(%"struct.PrintInfo::Encoding4Uniform") align 1) #25 comdat !dbg !1751 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10013,7 +10013,7 @@ define internal i32 @_ZN7details18_cm_print_type_oclIPvEENS_18SHADER_PRINTF_TYPE
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2061 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET_T0_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2061 {
-   %4 = alloca i8, align 1
-   %5 = alloca %class.VaryingWriter, align 32
-   %6 = alloca %"struct.PrintInfo::Encoding4Varying", align 1
-@@ -10036,7 +10036,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %22 = bitcast %class.VaryingWriter* %5 to i8*, !dbg !2063
-   %23 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2063
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %22, i8* align 32 %23, i64 64, i1 false), !dbg !2063, !tbaa.struct !197
--  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.VaryingWriter* byval align 32 %5, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %6), !dbg !2064
-+  %24 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %21, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %5, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %6), !dbg !2064
-   br i1 %24, label %60, label %25, !dbg !2065
- 
- ; <label>:25:                                     ; preds = %3
-@@ -10044,7 +10044,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %27 = bitcast %class.VaryingWriter* %7 to i8*, !dbg !2067
-   %28 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2067
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %27, i8* align 32 %28, i64 64, i1 false), !dbg !2067, !tbaa.struct !197
--  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.VaryingWriter* byval align 32 %7, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %8), !dbg !2068
-+  %29 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %26, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %7, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %8), !dbg !2068
-   br i1 %29, label %60, label %30, !dbg !2069
- 
- ; <label>:30:                                     ; preds = %25
-@@ -10052,7 +10052,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %32 = bitcast %class.VaryingWriter* %9 to i8*, !dbg !2071
-   %33 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2071
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %32, i8* align 32 %33, i64 64, i1 false), !dbg !2071, !tbaa.struct !197
--  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.VaryingWriter* byval align 32 %9, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %10), !dbg !2072
-+  %34 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %31, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %9, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %10), !dbg !2072
-   br i1 %34, label %60, label %35, !dbg !2073
- 
- ; <label>:35:                                     ; preds = %30
-@@ -10060,7 +10060,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %37 = bitcast %class.VaryingWriter* %11 to i8*, !dbg !2075
-   %38 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2075
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %37, i8* align 32 %38, i64 64, i1 false), !dbg !2075, !tbaa.struct !197
--  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.VaryingWriter* byval align 32 %11, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %12), !dbg !2076
-+  %39 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %36, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %11, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %12), !dbg !2076
-   br i1 %39, label %60, label %40, !dbg !2077
- 
- ; <label>:40:                                     ; preds = %35
-@@ -10068,7 +10068,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %42 = bitcast %class.VaryingWriter* %13 to i8*, !dbg !2079
-   %43 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2079
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %42, i8* align 32 %43, i64 64, i1 false), !dbg !2079, !tbaa.struct !197
--  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.VaryingWriter* byval align 32 %13, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %14), !dbg !2080
-+  %44 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %41, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %13, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %14), !dbg !2080
-   br i1 %44, label %60, label %45, !dbg !2081
- 
- ; <label>:45:                                     ; preds = %40
-@@ -10076,7 +10076,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %47 = bitcast %class.VaryingWriter* %15 to i8*, !dbg !2083
-   %48 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2083
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %47, i8* align 32 %48, i64 64, i1 false), !dbg !2083, !tbaa.struct !197
--  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.VaryingWriter* byval align 32 %15, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %16), !dbg !2084
-+  %49 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %46, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %15, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %16), !dbg !2084
-   br i1 %49, label %60, label %50, !dbg !2085
- 
- ; <label>:50:                                     ; preds = %45
-@@ -10084,7 +10084,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %52 = bitcast %class.VaryingWriter* %17 to i8*, !dbg !2087
-   %53 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2087
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %52, i8* align 32 %53, i64 64, i1 false), !dbg !2087, !tbaa.struct !197
--  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.VaryingWriter* byval align 32 %17, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %18), !dbg !2088
-+  %54 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %51, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %17, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %18), !dbg !2088
-   br i1 %54, label %60, label %55, !dbg !2089
- 
- ; <label>:55:                                     ; preds = %50
-@@ -10092,7 +10092,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
-   %57 = bitcast %class.VaryingWriter* %19 to i8*, !dbg !2091
-   %58 = bitcast %class.VaryingWriter* %1 to i8*, !dbg !2091
-   call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 32 %57, i8* align 32 %58, i64 64, i1 false), !dbg !2091, !tbaa.struct !197
--  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.VaryingWriter* byval align 32 %19, %"struct.PrintInfo::Encoding4Varying"* byval align 1 %20), !dbg !2092
-+  %59 = call zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext %56, %class.VaryingWriter* byval(%class.VaryingWriter) align 32 %19, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1 %20), !dbg !2092
-   br label %60, !dbg !2089
- 
- ; <label>:60:                                     ; preds = %55, %50, %45, %40, %35, %30, %25, %3
-@@ -10101,7 +10101,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail14switchEncodingI13VaryingWriter
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2094 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2094 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10127,7 +10127,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIb13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2103 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2103 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10153,7 +10153,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIi13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2112 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2112 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10179,7 +10179,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIj13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2121 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2121 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10205,7 +10205,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIf13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2130 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2130 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10231,7 +10231,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIx13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2139 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2139 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10257,7 +10257,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIy13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2148 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2148 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
-@@ -10283,7 +10283,7 @@ define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingId13Varyi
- }
- 
- ; Function Attrs: alwaysinline inlinehint nounwind
--define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval align 32, %"struct.PrintInfo::Encoding4Varying"* byval align 1) #25 comdat !dbg !2157 {
-+define internal zeroext i1 @_ZN9PrintInfo6detail21applyIfProperEncodingIPv13VaryingWriterNS_16Encoding4VaryingEEEbNS_8EncodingET0_T1_(i8 signext, %class.VaryingWriter* byval(%class.VaryingWriter) align 32, %"struct.PrintInfo::Encoding4Varying"* byval(%"struct.PrintInfo::Encoding4Varying") align 1) #25 comdat !dbg !2157 {
-   %4 = alloca i1, align 1
-   %5 = alloca i8, align 1
-   store i8 %0, i8* %5, align 1, !tbaa !193
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 9c3acb42a9cf..d61dcc1b961a 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,19 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.15.0
-revision=2
+version=1.18.1.r290+e88e49e
+revision=1
+_ispc_commit=e88e49eb161aa5e75aecc843d479d5e757f5c43e
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
 makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
-distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=2658ff00dc045ac9fcefbf6bd26dffaf723b059a942a27df91bbb61bc503a285
+distfiles="https://github.com/ispc/ispc/archive/${_ispc_commit}.tar.gz"
+checksum=e0181f0f4dc78809166a8c28a46a3cb1f24d3dbbead4f4ff7e4ebfd8d109ebbd
 nocross=yes
 nopie=yes
 
@@ -22,7 +23,7 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 
 pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
+	vsed -i '/tinfo/d' CMakeLists.txt
 }
 
 post_install() {

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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (76 preceding siblings ...)
  2023-02-22 19:41 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-02-24 22:55 ` Johnnynator
  2023-03-01 14:02 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (16 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: Johnnynator @ 2023-02-24 22:55 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1444617897

Comment:
Did a git bisect on the 32bit arm build failure.

It broke with the following commit https://github.com/llvm/llvm-project/commit/425620ccdd47e56b59512913cdc71e116f951e4e but I'm unsure on how to fix it correctly.

```
/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__x() const [clone .localalias]':
locale.cpp:(.text._ZNKSt3__120__time_get_c_storageIcE3__xEv+0xb4): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__X() const [clone .localalias]':
```

Build log: https://gist.github.com/Johnnynator/e9dddc63100c212303fb81aa27cc39f6

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

* Re: [PR PATCH] [Updated] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (77 preceding siblings ...)
  2023-02-24 22:55 ` Johnnynator
@ 2023-03-01 14:02 ` tranzystorek-io
  2023-03-10 14:35 ` tranzystorek-io
                   ` (15 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-03-01 14:02 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From f65960b0d34508b0929617b1e53ee22e6a3ca18d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   4 +-
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 0f9c75af44bc..691d105d82d1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -717,7 +717,6 @@ libmca_common_dstore.so.1 libopenmpi-4.0.1_1
 libmca_common_ompio.so.41 libopenmpi-3.0.1_1
 libmca_common_monitoring.so.50 libopenmpi-3.1.2_1
 libmpi.so.40 libopenmpi-3.0.1_1
-libomp.so libomp-12.0.1_4
 libompitrace.so.40 libopenmpi-3.0.1_1
 libopen-pal.so.40 libopenmpi-3.0.1_1
 libopen-rte.so.40 libopenmpi-3.0.1_1
@@ -993,7 +992,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 554d47a9a8fb32f3beed305383ecccfba0f216b1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 691d105d82d1..208e79acc380 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 794761d5becd2c8cfd827fe2728a03e8a9545847 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 41c78bb4f3c8e12a1c1d552cdb97ce0ef18ef1d8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 208e79acc380..67c5c171fc2a 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -993,7 +993,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From e6245b786e861105f3a10b13baa4eeb76db92f30 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 8b926d7547a87d51f59da68dd62b7bfeee51ebbc Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 38d319a579794905c4555b88d23f598fc48e2ae1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 952682662128..2f01dbf69530 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=1
+revision=2
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From 8565f6ac2a5d329fe8c190e453c4a2147ed92cc5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From d2fff586f26d63a86a589066c71757f24cccb7bf Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From e91178e02de20c219ed9c7c7ffa9b938d08165df Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 42d1a1cde8458f3fd5fb42b7fc6f7b0a4323979e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 5654135fb10cea3fbc7276417bc45f9f5e44e9c2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 7f3ae433634ac13a4a410ea3554840bc14e2f898 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 66fa63daf73a08f448bd324a48c2650bd648d6a2 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From ad547d21a876f08e669914eaac03733b60d2183f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 69c9bba1b881..87bb6b2d43f7 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 0d4ea1a2b5e50c04839d4ea25e369d2407ed4a11 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 6794a99edac5446720e828cbef159c7677ac96f0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 5c48f1345c64c888816eb652b596dc03d2233cfb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 33b6e206f889819af9c5e7e25ba410bc9ef0902a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 875f238c2a07e3909bc47d4f80db8ba89b133788 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 9835b56bf6042c0916a04d739e0ba3f61e1e68c5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index 67c5c171fc2a..8615c6fb7906 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2197,10 +2197,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From 9b3bad20d432c520419a54fdb3b7df38570c44d3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From e004d07d266a8d78bbf9d3edbed59826b5a9ffab Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From de8c3fb2efd9983a2fc07f122a3eb466ccc25897 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index 8eb1b7891f60..e8324b27077c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
 hostmakedepends="clang llvm perl pkg-config python3 which

From c819e3eba1813a69c99c4a9436a76770cd3dd72e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..74ccb4dd4592 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,9 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
@@ -13,8 +15,15 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+patch_args="-d ${build_wrksrc} -Np1"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From 43ef7c26131902931ec12265f74377b9d21904ae Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 1 Mar 2023 14:59:55 +0100
Subject: [PATCH 26/26] ispc: update to 1.19.0

---
 srcpkgs/ispc/patches/cmake-build-type-none.patch | 13 +++++++++++++
 srcpkgs/ispc/template                            | 12 ++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..a962619d9335
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+     # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 2b06217d0aab..574a75bab7e6 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,18 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.18.1
+version=1.19.0
 revision=1
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF -DCMAKE_BUILD_TYPE=Release"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
-makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel libomp-devel"
+makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
 distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=5b004c121e7a39c8654bb61930a240e4bd3e432a80d851c6281fae49f9aca7b7
+checksum=da1eccb8ead495b22d642340f3bab11fb64dd2223cd9cc92f0492f70b30f34b5
 nocross=yes
 nopie=yes
 
@@ -21,10 +21,6 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64) hostmakedepends+=" gcc-multilib";;
 esac
 
-pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
-}
-
 post_install() {
 	vlicense LICENSE.txt
 }

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

* Re: [PR PATCH] [Updated] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (78 preceding siblings ...)
  2023-03-01 14:02 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-03-10 14:35 ` tranzystorek-io
  2023-03-13 14:25 ` motorto
                   ` (14 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-03-10 14:35 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From cc39fd9d91a6af6d6afa37f85376d8060e307280 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   4 +-
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 5cc81b9f90b2..853e6073828d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -717,7 +717,6 @@ libmca_common_dstore.so.1 libopenmpi-4.0.1_1
 libmca_common_ompio.so.41 libopenmpi-3.0.1_1
 libmca_common_monitoring.so.50 libopenmpi-3.1.2_1
 libmpi.so.40 libopenmpi-3.0.1_1
-libomp.so libomp-12.0.1_4
 libompitrace.so.40 libopenmpi-3.0.1_1
 libopen-pal.so.40 libopenmpi-3.0.1_1
 libopen-rte.so.40 libopenmpi-3.0.1_1
@@ -992,7 +991,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 944cb0ecce7bc743592d7cc1da07c2a670615270 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 853e6073828d..a1e70af525ef 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -986,9 +986,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 5f5a92cc3447c23011324969a3b68c2ff7d51071 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From b188ff670e44528c92bc79932dcc4110cb888373 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index a1e70af525ef..5d4a92a9766d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 2afcaf3fac3f6dab3427d3e1278d73673bea5a34 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From d3da3796192fa3986fc239b472ba204ba75c1545 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 7be70e956e41062c1846360e48e4927b58184b69 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 574930427ad1..eb8e37994498 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=2
+revision=3
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From d56d3239cc8c0a1ac405a066a970cb25d678138a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

---
 srcpkgs/CastXML/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 5d7d9503658c..28c424c78073 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.4.6
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,8 +12,8 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
-checksum=8dcdbc1f23a130e4bdb0b09f57c30761a02a346b4db4037555048af2a293d66a
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
+checksum=bb9024ec9ea5082e0d527f19bf3c2df79f1699f54b6cec168c024e727b32e6d1
 
 post_install() {
 	rm -r ${DESTDIR}/usr/share/castxml/clang/include

From 02c2880cd167b4e584b83d6fbe1b36196eb2444f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 53f9b3b0e788e72e2c2a5029a95be8005f1f8c42 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 61de3b0c83433a09811bd4ff28311b01dbf06ca9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From b57aea3f602d4423b8fd81eeae37f1f177ad1681 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From db1597b196dbbe8cc1400aa9fb87b7ef1fae7d53 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From ef65c5715b4aa6b7161c0cb9c625fef35082dee3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From bb842977eb0be71072e7fb00c61cae4108b05eb9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 69c9bba1b881..87bb6b2d43f7 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 4494d43a0a34c7a47d5f80a09723d42eeb907ff1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 6d4ca9d1b7b26bd1ca996151975342a26be00149 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From e7e8bec70a51bb5ddc5da3a12f13bddba0f93d2f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 1aab88609b326e2080e1f80e42b50d9517f9763e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 0619793a5692bac500d30ce5f54c71f186816f95 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From d16e2c390a234c94418da62d48ad95fa247a44e9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index 5d4a92a9766d..4f7abaafc980 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2196,10 +2196,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From 31d64fcc6c365488aa208a42e7931faf94bcffd0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From 02505c80cd311fb3829d719d8af5a496b75cff14 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From bde4548882b0f573b8741f411ab984fcb0267993 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index 8eb1b7891f60..e8324b27077c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
 hostmakedepends="clang llvm perl pkg-config python3 which

From 619dde465037973aa29c6bb1d0e78815674fae23 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..74ccb4dd4592 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,9 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
@@ -13,8 +15,15 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+patch_args="-d ${build_wrksrc} -Np1"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From 1ba59800e7956e5e9d6f7a746829784aba452b13 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 1 Mar 2023 14:59:55 +0100
Subject: [PATCH 26/26] ispc: update to 1.19.0

---
 srcpkgs/ispc/patches/cmake-build-type-none.patch | 13 +++++++++++++
 srcpkgs/ispc/template                            | 12 ++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..a962619d9335
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+     # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 2b06217d0aab..574a75bab7e6 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,18 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.18.1
+version=1.19.0
 revision=1
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF -DCMAKE_BUILD_TYPE=Release"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
-makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel libomp-devel"
+makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
 distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=5b004c121e7a39c8654bb61930a240e4bd3e432a80d851c6281fae49f9aca7b7
+checksum=da1eccb8ead495b22d642340f3bab11fb64dd2223cd9cc92f0492f70b30f34b5
 nocross=yes
 nopie=yes
 
@@ -21,10 +21,6 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64) hostmakedepends+=" gcc-multilib";;
 esac
 
-pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
-}
-
 post_install() {
 	vlicense LICENSE.txt
 }

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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (79 preceding siblings ...)
  2023-03-10 14:35 ` tranzystorek-io
@ 2023-03-13 14:25 ` motorto
  2023-03-13 14:27 ` tranzystorek-io
                   ` (13 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: motorto @ 2023-03-13 14:25 UTC (permalink / raw)
  To: ml

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

New comment by motorto on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1466240698

Comment:
Missing a review only, right ? Or anything I could try to help ? 

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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (80 preceding siblings ...)
  2023-03-13 14:25 ` motorto
@ 2023-03-13 14:27 ` tranzystorek-io
  2023-03-18  3:31 ` ihameed
                   ` (12 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-03-13 14:27 UTC (permalink / raw)
  To: ml

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

New comment by tranzystorek-io on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1466246146

Comment:
> Did a git bisect on the 32bit arm build failure.
> 
> It broke with the following commit [llvm/llvm-project@425620c](https://github.com/llvm/llvm-project/commit/425620ccdd47e56b59512913cdc71e116f951e4e) but I'm unsure on how to fix it correctly.
> 
> ```
> /usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__x() const [clone .localalias]':
> locale.cpp:(.text._ZNKSt3__120__time_get_c_storageIcE3__xEv+0xb4): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
> /usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__X() const [clone .localalias]':
> ```
> 
> Build log: https://gist.github.com/Johnnynator/e9dddc63100c212303fb81aa27cc39f6

This is still unresolved, I'll add it to the TODO list.

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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (81 preceding siblings ...)
  2023-03-13 14:27 ` tranzystorek-io
@ 2023-03-18  3:31 ` ihameed
  2023-03-18  3:39 ` ihameed
                   ` (11 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: ihameed @ 2023-03-18  3:31 UTC (permalink / raw)
  To: ml

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

New comment by ihameed on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1474661456

Comment:
The 32-bit ARM failure is caused by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180. Some immediate options:
1. patch libc++: https://gist.github.com/ihameed/b226d72537e8a4a8e9c590bef529a137, or
2. build libc++ with clang by using `-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind"` instead of `-DLLVM_ENABLE_PROJECTS="...;libcxx;libcxxabi;libunwind;..."`.


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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (82 preceding siblings ...)
  2023-03-18  3:31 ` ihameed
@ 2023-03-18  3:39 ` ihameed
  2023-03-18  4:46 ` ihameed
                   ` (10 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: ihameed @ 2023-03-18  3:39 UTC (permalink / raw)
  To: ml

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

New comment by ihameed on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1474661456

Comment:
The 32-bit ARM failure is caused by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180. Some immediate options:
1. patch libc++: https://gist.github.com/ihameed/b226d72537e8a4a8e9c590bef529a137 (alternatively, build string.cpp with -fno-inline), or
2. build libc++ with clang by using `-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind"` instead of `-DLLVM_ENABLE_PROJECTS="...;libcxx;libcxxabi;libunwind;..."`.


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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (83 preceding siblings ...)
  2023-03-18  3:39 ` ihameed
@ 2023-03-18  4:46 ` ihameed
  2023-03-18  9:35 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (9 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: ihameed @ 2023-03-18  4:46 UTC (permalink / raw)
  To: ml

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

New comment by ihameed on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1474661456

Comment:
The 32-bit ARM failure is caused by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180. Some immediate options:
1. patch libc++: https://gist.github.com/ihameed/b226d72537e8a4a8e9c590bef529a137 (alternatively, build string.cpp with -fno-inline), or
2. build libc++ with clang (although you'd need to arrange for there to be a host-executable clang to use for this, possibly via the same way tablegen is built)

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

* Re: [PR PATCH] [Updated] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (84 preceding siblings ...)
  2023-03-18  4:46 ` ihameed
@ 2023-03-18  9:35 ` tranzystorek-io
  2023-03-18 16:35 ` tranzystorek-io
                   ` (8 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-03-18  9:35 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/
- [ ] Fix arm 32bit build https://github.com/void-linux/void-packages/pull/40821#issuecomment-1444617897

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From 8ec516795fd707c1a417188504016d923a26afcf Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   4 +-
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 442 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1063 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 8a7c321774fc..5fd080c540a5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -717,7 +717,6 @@ libmca_common_dstore.so.1 libopenmpi-4.0.1_1
 libmca_common_ompio.so.41 libopenmpi-3.0.1_1
 libmca_common_monitoring.so.50 libopenmpi-3.1.2_1
 libmpi.so.40 libopenmpi-3.0.1_1
-libomp.so libomp-12.0.1_4
 libompitrace.so.40 libopenmpi-3.0.1_1
 libopen-pal.so.40 libopenmpi-3.0.1_1
 libopen-rte.so.40 libopenmpi-3.0.1_1
@@ -992,7 +991,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..4d2777451e24
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,442 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-rename
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/diagtool
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/bin/sancov
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*rename*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/diagtool.1
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 85f48043d2e4677a15d29ef5a0e9c136f3196944 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 5fd080c540a5..1310f006732d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -986,9 +986,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 811ba142ed7bc3d74e4bb14ba3393b001f902958 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 9aaf2606661c95151a8079fe823398439a098737 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 1310f006732d..517ef97d2260 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 968d9ac8f93e41db3e3363ce4167cbdb00c50d03 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 780cf7866da567ab47e932dd756e5adcaf08821f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From c2c1182ac05c808bddd828680f1b489e27ebd4dd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 574930427ad1..eb8e37994498 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=2
+revision=3
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From f6489692a1044ebebb19b2b4047b114709d60d07 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 00e82ac66b50..de0920900ae4 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,7 +12,7 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
 checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
 
 post_install() {

From 186bf37fb9fc8e7577ddfa60f3ca171134719b9b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 543ae06d78ab9d1b9980831936d58c610b66dca6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 46d0753e6656fd26ff640b467e1f23af30db8941 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 878d1b3f513a750a7d772ad718ea651cf3531a24 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 09c05709cf7321d1621a95cf300f51fc1ba56c42 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 2fd69bfb66b8f8536635dabcc7fdc93f941771b0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 9587f14e1953e59ee16c3252d54232b8a96da57f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 69c9bba1b881..87bb6b2d43f7 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 6ec43576e41c585f09c7eec511a898ef3caf0f81 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 674f00fbddbd3e193e9b391343ac04398d1bc63f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 2c28c218eb6b656c00749cbc9d3a98246349ad82 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 07ec94b687a3aa119c6169576895eee6f10573e9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From c1acb8eb9950a136b8a640e2175dffc4f4aed580 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 2ce4a1bcc3c7956876028ae84be7774c6d201d03 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index 517ef97d2260..e821b07d5434 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2196,10 +2196,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From f3db2a0afea6e5044ace0c2c59afbbe1d83e82ed Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From c9261ad84d3d652c51c8ece828f775f5163394f7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From 0b0db32f6efe8aabd936666b8b8c8eea2d93456d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index 8eb1b7891f60..e8324b27077c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
 hostmakedepends="clang llvm perl pkg-config python3 which

From ce79d70d04ff4e5482014a79d68e7d985e3c2a1c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..74ccb4dd4592 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,9 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
@@ -13,8 +15,15 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+patch_args="-d ${build_wrksrc} -Np1"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From 8024d6c96ea50cbfa25c1fc5a8f8512a44060d12 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 1 Mar 2023 14:59:55 +0100
Subject: [PATCH 26/26] ispc: update to 1.19.0

---
 srcpkgs/ispc/patches/cmake-build-type-none.patch | 13 +++++++++++++
 srcpkgs/ispc/template                            | 12 ++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..a962619d9335
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+     # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 2b06217d0aab..574a75bab7e6 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,18 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.18.1
+version=1.19.0
 revision=1
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF -DCMAKE_BUILD_TYPE=Release"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
-makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel libomp-devel"
+makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
 distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=5b004c121e7a39c8654bb61930a240e4bd3e432a80d851c6281fae49f9aca7b7
+checksum=da1eccb8ead495b22d642340f3bab11fb64dd2223cd9cc92f0492f70b30f34b5
 nocross=yes
 nopie=yes
 
@@ -21,10 +21,6 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64) hostmakedepends+=" gcc-multilib";;
 esac
 
-pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
-}
-
 post_install() {
 	vlicense LICENSE.txt
 }

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

* Re: [PR PATCH] [Updated] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (85 preceding siblings ...)
  2023-03-18  9:35 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-03-18 16:35 ` tranzystorek-io
  2023-03-25  6:04 ` oreo639
                   ` (7 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-03-18 16:35 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/
- [ ] Fix arm 32bit build https://github.com/void-linux/void-packages/pull/40821#issuecomment-1444617897

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From dd666345efc07d69aeaba0e9cb97f2e853ac2c47 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   4 +-
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 +
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 450 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 23 files changed, 1071 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 8a7c321774fc..5fd080c540a5 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -717,7 +717,6 @@ libmca_common_dstore.so.1 libopenmpi-4.0.1_1
 libmca_common_ompio.so.41 libopenmpi-3.0.1_1
 libmca_common_monitoring.so.50 libopenmpi-3.1.2_1
 libmpi.so.40 libopenmpi-3.0.1_1
-libomp.so libomp-12.0.1_4
 libompitrace.so.40 libopenmpi-3.0.1_1
 libopen-pal.so.40 libopenmpi-3.0.1_1
 libopen-rte.so.40 libopenmpi-3.0.1_1
@@ -992,7 +991,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..adad30265bef
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,450 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-change-namespace
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-move
+		vmove usr/bin/clang-pseudo
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangChangeNamespace*"
+		vmove "usr/lib/libclangDaemon*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeCleaner*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangMove*"
+		vmove "usr/lib/libclangPseudo*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/lib/libclangd*"
+		vmove "usr/lib/libfindAllSymbols*"
+		vmove "usr/share/clang/*find-all-symbols*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From b47f1a553b577e568ee1a24dcb13f443bbcd8019 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 5fd080c540a5..1310f006732d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -986,9 +986,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From f2e8746aecbdddfd1fea8ad10cd496b3f62ffac6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From bf22ea3b73e1228fcef53467aab182c8d9d860b4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 1310f006732d..517ef97d2260 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -992,7 +992,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 3cbedaf3eeb963355331621be0bf7ad548fdf11e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 47d0fe2d31da1afb6585d0dfc335342089ad44ae Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 8464758074585f9d5b1ebf02c92e065c2e046f40 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 574930427ad1..eb8e37994498 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=2
+revision=3
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From 124bb9e664c5b67d97f567b6d8c27a50bfd445ba Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 00e82ac66b50..de0920900ae4 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,7 +12,7 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
 checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
 
 post_install() {

From 74763ad4ad97135bb9e345129cd4c642a4d873ad Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 1a4200bc335c3958445f1f7e198b33b550bddf41 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 220bfb7279bc39a6797c9b29ff69211b22c86105 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 1cb76c550f5e4822b2aefd296e0e9172d5c3c473 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 6fa75b5a8233bd239107274d235fc959101d0259 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 4b6f37f329a5ac771c6dcb6ca358d5541c38a745 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From e84caba1883d23d29e4aa92a7dad08829500fbd4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 69c9bba1b881..87bb6b2d43f7 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From e796093f8a5c139cd183752be0e0ef77580ef121 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 56ca098d5d3add5babf48bc848286382f36c02c3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From a112e9f8f2bbb608d40d9700461d2b294d2af2ab Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 879895b89d23d82d01b937451603154f3ebde2b6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 210f973091993cb18357605d7c9ff81eb606d6ab Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From c1a8d0db09a0c9cea282445045f2d14f6a6ecbf5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index 517ef97d2260..e821b07d5434 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2196,10 +2196,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From c74059a40b8e32d869d196813cc0c170795007a0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From d0d172161d49a36a016174a635543af491e38da4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From 18bc113acc58b30669dc3b208b73039c00d0662b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index 8eb1b7891f60..e8324b27077c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
 hostmakedepends="clang llvm perl pkg-config python3 which

From f77e3488e07a8679bf2b483f07209e4d20b86a74 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..74ccb4dd4592 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,9 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
@@ -13,8 +15,15 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+patch_args="-d ${build_wrksrc} -Np1"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From ef8d3aec15657b0abdad49dba9f658358938ae44 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 1 Mar 2023 14:59:55 +0100
Subject: [PATCH 26/26] ispc: update to 1.19.0

---
 srcpkgs/ispc/patches/cmake-build-type-none.patch | 13 +++++++++++++
 srcpkgs/ispc/template                            | 12 ++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..a962619d9335
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+     # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 2b06217d0aab..574a75bab7e6 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,18 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.18.1
+version=1.19.0
 revision=1
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF -DCMAKE_BUILD_TYPE=Release"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
-makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel libomp-devel"
+makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
 distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=5b004c121e7a39c8654bb61930a240e4bd3e432a80d851c6281fae49f9aca7b7
+checksum=da1eccb8ead495b22d642340f3bab11fb64dd2223cd9cc92f0492f70b30f34b5
 nocross=yes
 nopie=yes
 
@@ -21,10 +21,6 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64) hostmakedepends+=" gcc-multilib";;
 esac
 
-pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
-}
-
 post_install() {
 	vlicense LICENSE.txt
 }

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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (86 preceding siblings ...)
  2023-03-18 16:35 ` tranzystorek-io
@ 2023-03-25  6:04 ` oreo639
  2023-03-25 13:04 ` [PR PATCH] [Updated] " tranzystorek-io
                   ` (6 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: oreo639 @ 2023-03-25  6:04 UTC (permalink / raw)
  To: ml

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

New comment by oreo639 on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1483737316

Comment:
ihameed, tysm for looking into it. I can confirm that adding `-fno-inline` to the compile flags for string.cpp does indeed allow llvm15 to compile on arm:
https://gist.github.com/oreo639/7c59c0576ecc4378dbebbe3c2730fdfe

Also, @tranzystorek-io can you add back the description for the libcxxabi-musl patch (or at least have some kind of description for it):
> gcc does not support using abi_tag in an extern "C" declaration:
> https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359

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

* Re: [PR PATCH] [Updated] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (87 preceding siblings ...)
  2023-03-25  6:04 ` oreo639
@ 2023-03-25 13:04 ` tranzystorek-io
  2023-03-25 13:10 ` tranzystorek-io
                   ` (5 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-03-25 13:04 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/
- [ ] Fix arm 32bit build https://github.com/void-linux/void-packages/pull/40821#issuecomment-1444617897

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From a9a417d2b32600531c0e2835238be00a0d0f6ea6 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   4 +-
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  29 ++
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 451 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 24 files changed, 1097 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index b8d161c2d932..07a6fa978493 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -718,7 +718,6 @@ libmca_common_dstore.so.1 libopenmpi-4.0.1_1
 libmca_common_ompio.so.41 libopenmpi-3.0.1_1
 libmca_common_monitoring.so.50 libopenmpi-3.1.2_1
 libmpi.so.40 libopenmpi-3.0.1_1
-libomp.so libomp-12.0.1_4
 libompitrace.so.40 libopenmpi-3.0.1_1
 libopen-pal.so.40 libopenmpi-3.0.1_1
 libopen-rte.so.40 libopenmpi-3.0.1_1
@@ -993,7 +992,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-armv67.patch b/srcpkgs/llvm15/patches/libcxx-armv67.patch
new file mode 100644
index 000000000000..1dab312c83e3
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-armv67.patch
@@ -0,0 +1,22 @@
+See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180
+Avoid the following undefined reference:
+
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__x() const [clone .localalias]':
+locale.cpp:(.text._ZNKSt3__120__time_get_c_storageIcE3__xEv+0xb4): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__X() const [clone .localalias]':
+
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,12 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIB
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++set(VOID_GCC_BUG_109180_WORKAROUND OFF CACHE BOOL "")
++
++if (VOID_GCC_BUG_109180_WORKAROUND)
++  set_source_files_properties(string.cpp PROPERTIES COMPILE_FLAGS -fno-inline)
++endif()
++
+ if (APPLE AND LLVM_USE_SANITIZER)
+   if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
+       ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..74e350a776ef
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,29 @@
+gcc does not support using abi_tag in an extern "C" declaration:
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..55bf6f5aaa08
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..cf7bde85e40d
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,451 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+		armv*) configure_args+=" -DVOID_GCC_BUG_109180_WORKAROUND=ON" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-change-namespace
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-move
+		vmove usr/bin/clang-pseudo
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangChangeNamespace*"
+		vmove "usr/lib/libclangDaemon*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeCleaner*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangMove*"
+		vmove "usr/lib/libclangPseudo*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/lib/libclangd*"
+		vmove "usr/lib/libfindAllSymbols*"
+		vmove "usr/share/clang/*find-all-symbols*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 01f9eba9279aa3aef0286f080d96f08d27db376a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 07a6fa978493..2bb8b25deccb 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 731a38294b06757ba392d0ee5bfa61fd98c5b182 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 83588dbb7f65c8740f93ae4a4542f8d9e95215ca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 2bb8b25deccb..e5071f45c0c8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -993,7 +993,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 21ade725bea06fa915fa34a4be8319d8cfbedb68 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From d0a0f36273c1057e916ac03d37c58fd7d75db32b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 103dc691d2219ff07d719d35ed9e314a5dd2223a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 574930427ad1..eb8e37994498 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=2
+revision=3
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From f726a0b3bccbf3a0852991ab112961d50ff5f807 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 00e82ac66b50..de0920900ae4 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,7 +12,7 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
 checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
 
 post_install() {

From 0f873ae419ab509dea2f6e70ba7f5f4b08ca84e9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 800fd0705bc6c160ae0597c3febaadc0c4869a5d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 92347e27b963173b887ca176416b70158cdc0eb9 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From e41384b7be2acbcc51e79ad1396766edeb099a21 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 135ecd46458d4de23c454a69b8d65e463a27c132 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 597c5d3ae6b8adef67d420fd39a435e47ab102eb Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From ba5ff03ae53df48661cdfd7ef332e402d4658b39 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 69c9bba1b881..87bb6b2d43f7 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From faf4412c2c149bb209576f527b34a5b4d89231d5 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From e54653c660d1a9d29562337ca8b00dafb84f5598 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 68b2fabf949fd81f32f30f04398d00c90fe462cf Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From 7b4c8f2b687d7d61ac6f0add537464bd8063da6c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 5782042e7a5c489622aadb4a58f1d302d3a6b03b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 652371b62b9639d230524ebda2b74d529f99026e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index e5071f45c0c8..1b68be307437 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2197,10 +2197,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From 74c3d037fba6f9b635847eb93304418c922adfe4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From 80657ae8d5cc5a27912cc6c779bb97b240d2e898 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From fae8ad15ef63a69922f17e4f9e951b7905b1b2e1 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index 8eb1b7891f60..e8324b27077c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
 hostmakedepends="clang llvm perl pkg-config python3 which

From 1dea203d287be87aeb0baf49d5b164b90e18cb2a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..74ccb4dd4592 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,9 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
@@ -13,8 +15,15 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+patch_args="-d ${build_wrksrc} -Np1"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From 598fec22838b49bfb4f71c0eb261dd8f481c5ad0 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 1 Mar 2023 14:59:55 +0100
Subject: [PATCH 26/26] ispc: update to 1.19.0

---
 srcpkgs/ispc/patches/cmake-build-type-none.patch | 13 +++++++++++++
 srcpkgs/ispc/template                            | 12 ++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..a962619d9335
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+     # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 2b06217d0aab..574a75bab7e6 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,18 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.18.1
+version=1.19.0
 revision=1
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF -DCMAKE_BUILD_TYPE=Release"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
-makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel libomp-devel"
+makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
 distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=5b004c121e7a39c8654bb61930a240e4bd3e432a80d851c6281fae49f9aca7b7
+checksum=da1eccb8ead495b22d642340f3bab11fb64dd2223cd9cc92f0492f70b30f34b5
 nocross=yes
 nopie=yes
 
@@ -21,10 +21,6 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64) hostmakedepends+=" gcc-multilib";;
 esac
 
-pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
-}
-
 post_install() {
 	vlicense LICENSE.txt
 }

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

* Re: [PR PATCH] [Updated] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (88 preceding siblings ...)
  2023-03-25 13:04 ` [PR PATCH] [Updated] " tranzystorek-io
@ 2023-03-25 13:10 ` tranzystorek-io
  2023-03-30 22:02 ` tranzystorek-io
                   ` (4 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-03-25 13:10 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/
- [x] Fix arm 32bit build https://github.com/void-linux/void-packages/pull/40821#issuecomment-1444617897

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From 271fb421f80cd8fe7381d9c81552aa747092941e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   4 +-
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 +
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  40 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 451 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 24 files changed, 1097 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index b8d161c2d932..07a6fa978493 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -718,7 +718,6 @@ libmca_common_dstore.so.1 libopenmpi-4.0.1_1
 libmca_common_ompio.so.41 libopenmpi-3.0.1_1
 libmca_common_monitoring.so.50 libopenmpi-3.1.2_1
 libmpi.so.40 libopenmpi-3.0.1_1
-libomp.so libomp-12.0.1_4
 libompitrace.so.40 libopenmpi-3.0.1_1
 libopen-pal.so.40 libopenmpi-3.0.1_1
 libopen-rte.so.40 libopenmpi-3.0.1_1
@@ -993,7 +992,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-armv67.patch b/srcpkgs/llvm15/patches/libcxx-armv67.patch
new file mode 100644
index 000000000000..1dab312c83e3
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-armv67.patch
@@ -0,0 +1,22 @@
+See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180
+Avoid the following undefined reference:
+
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__x() const [clone .localalias]':
+locale.cpp:(.text._ZNKSt3__120__time_get_c_storageIcE3__xEv+0xb4): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__X() const [clone .localalias]':
+
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,12 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIB
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++set(VOID_GCC_BUG_109180_WORKAROUND OFF CACHE BOOL "")
++
++if (VOID_GCC_BUG_109180_WORKAROUND)
++  set_source_files_properties(string.cpp PROPERTIES COMPILE_FLAGS -fno-inline)
++endif()
++
+ if (APPLE AND LLVM_USE_SANITIZER)
+   if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
+       ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..000c3b1c0c7b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,40 @@
+gcc does not support using abi_tag in an extern "C" declaration:
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..cf7bde85e40d
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,451 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+		armv*) configure_args+=" -DVOID_GCC_BUG_109180_WORKAROUND=ON" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-change-namespace
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-move
+		vmove usr/bin/clang-pseudo
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangChangeNamespace*"
+		vmove "usr/lib/libclangDaemon*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeCleaner*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangMove*"
+		vmove "usr/lib/libclangPseudo*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/lib/libclangd*"
+		vmove "usr/lib/libfindAllSymbols*"
+		vmove "usr/share/clang/*find-all-symbols*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 5f3c5beeaa4c778e2a710fde271d4f2ac2f7698c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 07a6fa978493..2bb8b25deccb 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 32a0b603497b732bad7e96174c4026e1bee05d21 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 15ccf5ae25ed493c7486e6268925bee1997e2594 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 2bb8b25deccb..e5071f45c0c8 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -993,7 +993,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From b8b49d42d29b9373712fe239336511369de0a521 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 161371a5563f9bbb07700d8512840a389d3802db Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From f2dfd24e0820957483cdfdceecc72fbb986e6292 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 574930427ad1..eb8e37994498 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=2
+revision=3
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From a53acbf81be14a4848645cc00f0406c177a2a071 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 00e82ac66b50..de0920900ae4 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,7 +12,7 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
 checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
 
 post_install() {

From 339ac072f9cbc06c4aa1b66d1459a9027307f3a3 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 5c8e4ad0977e3e896e4ddcdca5e99812efcf0c7d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 9fec38851b9c7dc38a2b29c0085518a6dd0aec1f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From 785cb58deb348df61a93b8d131bf707567110229 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 0fbd769f699e29a87608515f912eea22d80a3f45 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 32141b05cc4b3e88289a07affcbb23ad3eccc41a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 779ae08e86cc3258473fcedea4236363745fb199 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 69c9bba1b881..87bb6b2d43f7 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 40f6034d5115ca270a4ef6af3460122cf851496a Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 54ff7a8b3afc7fecafc23517de55debff6e7a0fc Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From 1f82c6942ae990540fee7da5c35d68ef101895b8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From d775193dc13b930189f18d65eaa183a5376c2bca Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From c72cebeae8f6bf65265f2ed30ed14210d2bf719d Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 07cf0026014523f238533d48197686dc49bab10e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index e5071f45c0c8..1b68be307437 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2197,10 +2197,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From 60d6d61179d2a6fe081ef02dd0fcc3e342e52d28 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From e6a846d4984041902a4b66d0eb200a3fe7f3b2a7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From b4b80ef04f5ec3ec210fd62b0064d1df570f481b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index 8eb1b7891f60..e8324b27077c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
 hostmakedepends="clang llvm perl pkg-config python3 which

From 5d23094dabb3429e47ccc761ff23874e3a975b48 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..74ccb4dd4592 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,9 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
@@ -13,8 +15,15 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+patch_args="-d ${build_wrksrc} -Np1"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From e3784e6e2139b0bf5e3c61ff389e79b72efb4b90 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 1 Mar 2023 14:59:55 +0100
Subject: [PATCH 26/26] ispc: update to 1.19.0

---
 srcpkgs/ispc/patches/cmake-build-type-none.patch | 13 +++++++++++++
 srcpkgs/ispc/template                            | 12 ++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..a962619d9335
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+     # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 2b06217d0aab..574a75bab7e6 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,18 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.18.1
+version=1.19.0
 revision=1
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF -DCMAKE_BUILD_TYPE=Release"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
-makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel libomp-devel"
+makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
 distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=5b004c121e7a39c8654bb61930a240e4bd3e432a80d851c6281fae49f9aca7b7
+checksum=da1eccb8ead495b22d642340f3bab11fb64dd2223cd9cc92f0492f70b30f34b5
 nocross=yes
 nopie=yes
 
@@ -21,10 +21,6 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64) hostmakedepends+=" gcc-multilib";;
 esac
 
-pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
-}
-
 post_install() {
 	vlicense LICENSE.txt
 }

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

* Re: [PR PATCH] [Updated] LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (89 preceding siblings ...)
  2023-03-25 13:10 ` tranzystorek-io
@ 2023-03-30 22:02 ` tranzystorek-io
  2023-03-31 13:28 ` [PR PATCH] [Closed]: " leahneukirchen
                   ` (3 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-03-30 22:02 UTC (permalink / raw)
  To: ml

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

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

https://github.com/tranzystorek-io/void-packages llvm15
https://github.com/void-linux/void-packages/pull/40821

LLVM 15
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/
- [x] Fix arm 32bit build https://github.com/void-linux/void-packages/pull/40821#issuecomment-1444617897

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

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

From 5bad5e29da075c3df758b23937e70a20707acf93 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:36:59 +0100
Subject: [PATCH 01/26] New package: llvm15-15.0.7

---
 common/shlibs                                 |   4 +-
 srcpkgs/libllvm15                             |   1 +
 .../llvm15/files/llvm-Config-llvm-config.h    |   9 +
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../clang-003-ppc64-dynamic-linker-path.patch |  13 +
 .../patches/clang-004-ppc64-musl-elfv2.patch  |  48 ++
 .../compiler-rt-sanitizer-ppc64-musl.patch    |  35 ++
 srcpkgs/llvm15/patches/libcxx-armv67.patch    |  22 +
 srcpkgs/llvm15/patches/libcxx-musl.patch      |  26 +
 srcpkgs/llvm15/patches/libcxx-ppc.patch       |  22 +
 .../llvm15/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm15/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm15/patches/libcxxabi-musl.patch   |  40 ++
 srcpkgs/llvm15/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm15/patches/lldb-musl.patch        |  40 ++
 srcpkgs/llvm15/patches/llvm-001-musl.patch    |  57 +++
 .../patches/llvm-002-musl-ppc64-elfv2.patch   |  30 ++
 .../patches/llvm-003-ppc-secureplt.patch      |  11 +
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm15/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../patches/llvm-006-aarch64-mf_exec.patch    |  25 +
 srcpkgs/llvm15/template                       | 451 ++++++++++++++++++
 srcpkgs/llvm15/update                         |   3 +
 24 files changed, 1097 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/libllvm15
 create mode 100644 srcpkgs/llvm15/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
 create mode 100644 srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ppc.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm15/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm15/patches/lldb-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
 create mode 100644 srcpkgs/llvm15/template
 create mode 100644 srcpkgs/llvm15/update

diff --git a/common/shlibs b/common/shlibs
index 840a0c3197ab..0f4f21cef67d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -718,7 +718,6 @@ libmca_common_dstore.so.1 libopenmpi-4.0.1_1
 libmca_common_ompio.so.41 libopenmpi-3.0.1_1
 libmca_common_monitoring.so.50 libopenmpi-3.1.2_1
 libmpi.so.40 libopenmpi-3.0.1_1
-libomp.so libomp-12.0.1_4
 libompitrace.so.40 libopenmpi-3.0.1_1
 libopen-pal.so.40 libopenmpi-3.0.1_1
 libopen-rte.so.40 libopenmpi-3.0.1_1
@@ -993,7 +992,10 @@ libclang.so.12 libclang-12.0.0_1
 libclang-cpp.so.12 libclang-cpp-12.0.0_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
+libLLVM-15.so libllvm15-15.0.7_1
 libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libomp.so.5 libomp-15.0.7_1
+libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
 libmpack.so.0 libmpack-1.0.5_1
 libGeoIP.so.1 libgeoip-1.4.8_1
diff --git a/srcpkgs/libllvm15 b/srcpkgs/libllvm15
new file mode 120000
index 000000000000..ad57a969b9f9
--- /dev/null
+++ b/srcpkgs/libllvm15
@@ -0,0 +1 @@
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm15/files/llvm-Config-llvm-config.h b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm15/files/llvm-Config-llvm-config.h
@@ -0,0 +1,9 @@
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32
+#include "llvm-config-32.h"
+#elif __WORDSIZE == 64
+#include "llvm-config-64.h"
+#else
+#error "Unknown word size"
+#endif
diff --git a/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-001-fix-unwind-chain-inclusion.patch
@@ -0,0 +1,44 @@
+From 352974169f0d2b5da3d5321f588f5e3b5941330e Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:14:57 +0200
+Subject: [PATCH 2/7] fix unwind chain inclusion
+
+---
+ lib/Headers/unwind.h | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
+index 303d792..44e10cc 100644
+--- a/clang/lib/Headers/unwind.h
++++ b/clang/lib/Headers/unwind.h
+@@ -9,9 +9,6 @@
+ 
+ /* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
+ 
+-#ifndef __CLANG_UNWIND_H
+-#define __CLANG_UNWIND_H
+-
+ #if defined(__APPLE__) && __has_include_next(<unwind.h>)
+ /* Darwin (from 11.x on) provide an unwind.h. If that's available,
+  * use it. libunwind wraps some of its definitions in #ifdef _GNU_SOURCE,
+@@ -39,6 +36,9 @@
+ # endif
+ #else
+ 
++#ifndef __CLANG_UNWIND_H
++#define __CLANG_UNWIND_H
++
+ #include <stdint.h>
+ 
+ #ifdef __cplusplus
+@@ -322,6 +322,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
+ }
+ #endif
+ 
++#endif /* __CLANG_UNWIND_H */
++
+ #endif
+ 
+-#endif /* __CLANG_UNWIND_H */
+-- 
+2.5.1
diff --git a/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-002-add-musl-triples.patch
@@ -0,0 +1,115 @@
+--- a/clang/lib/Driver/ToolChains/Gnu.cpp
++++ b/clang/lib/Driver/ToolChains/Gnu.cpp
+@@ -2086,7 +2086,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+   static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
+                                              "armv7hl-redhat-linux-gnueabi",
+                                              "armv6hl-suse-linux-gnueabi",
+-                                             "armv7hl-suse-linux-gnueabi"};
++                                             "armv7hl-suse-linux-gnueabi",
++                                             "armv7l-linux-gnueabihf"};
+   static const char *const ARMebLibDirs[] = {"/lib"};
+   static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
+                                              "armeb-linux-androideabi"};
+@@ -2153,8 +2154,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+       "powerpc64-suse-linux", "powerpc-montavista-linuxspe"};
+   static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
+   static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
+-                                             "powerpcle-unknown-linux-gnu",
+-                                             "powerpcle-linux-musl"};
++                                             "powerpcle-unknown-linux-gnu"};
+ 
+   static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
+   static const char *const PPC64Triples[] = {
+@@ -2235,6 +2235,92 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
+     return;
+   }
+ 
++  if (TargetTriple.isMusl()) {
++    static const char *const AArch64MuslTriples[] = {"aarch64-linux-musl"};
++    static const char *const ARMHFMuslTriples[] = {
++        "arm-linux-musleabihf", "armv7l-linux-musleabihf"
++    };
++    static const char *const ARMMuslTriples[] = {"arm-linux-musleabi"};
++    static const char *const X86_64MuslTriples[] = {"x86_64-linux-musl"};
++    static const char *const X86MuslTriples[] = {"i686-linux-musl"};
++    static const char *const MIPSMuslTriples[] = {
++        "mips-linux-musl", "mipsel-linux-musl",
++        "mipsel-linux-muslhf", "mips-linux-muslhf"
++    };
++    static const char *const PPCMuslTriples[] = {"powerpc-linux-musl"};
++    static const char *const PPCLEMuslTriples[] = {"powerpcle-linux-musl"};
++    static const char *const PPC64MuslTriples[] = {"powerpc64-linux-musl"};
++    static const char *const PPC64LEMuslTriples[] = {"powerpc64le-linux-musl"};
++    static const char *const RISCV64MuslTriples[] = {"riscv64-linux-musl"};
++
++    switch (TargetTriple.getArch()) {
++    case llvm::Triple::aarch64:
++      LibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      TripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      BiarchLibDirs.append(begin(AArch64LibDirs), end(AArch64LibDirs));
++      BiarchTripleAliases.append(begin(AArch64MuslTriples), end(AArch64MuslTriples));
++      break;
++    case llvm::Triple::arm:
++      LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
++      if (TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF) {
++        TripleAliases.append(begin(ARMHFMuslTriples), end(ARMHFMuslTriples));
++      } else {
++        TripleAliases.append(begin(ARMMuslTriples), end(ARMMuslTriples));
++      }
++      break;
++    case llvm::Triple::x86_64:
++      LibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      TripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      BiarchLibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      BiarchTripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      break;
++    case llvm::Triple::x86:
++      LibDirs.append(begin(X86LibDirs), end(X86LibDirs));
++      TripleAliases.append(begin(X86MuslTriples), end(X86MuslTriples));
++      BiarchLibDirs.append(begin(X86_64LibDirs), end(X86_64LibDirs));
++      BiarchTripleAliases.append(begin(X86_64MuslTriples), end(X86_64MuslTriples));
++      break;
++    case llvm::Triple::mips:
++      LibDirs.append(begin(MIPSLibDirs), end(MIPSLibDirs));
++      TripleAliases.append(begin(MIPSMuslTriples), end(MIPSMuslTriples));
++      break;
++    case llvm::Triple::ppc:
++      LibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      TripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      BiarchTripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      break;
++    case llvm::Triple::ppcle:
++      LibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      TripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      BiarchLibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      BiarchTripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      break;
++    case llvm::Triple::ppc64:
++      LibDirs.append(begin(PPC64LibDirs), end(PPC64LibDirs));
++      TripleAliases.append(begin(PPC64MuslTriples), end(PPC64MuslTriples));
++      BiarchLibDirs.append(begin(PPCLibDirs), end(PPCLibDirs));
++      BiarchTripleAliases.append(begin(PPCMuslTriples), end(PPCMuslTriples));
++      break;
++    case llvm::Triple::ppc64le:
++      LibDirs.append(begin(PPC64LELibDirs), end(PPC64LELibDirs));
++      TripleAliases.append(begin(PPC64LEMuslTriples), end(PPC64LEMuslTriples));
++      BiarchLibDirs.append(begin(PPCLELibDirs), end(PPCLELibDirs));
++      BiarchTripleAliases.append(begin(PPCLEMuslTriples), end(PPCLEMuslTriples));
++      break;
++    case llvm::Triple::riscv64:
++      LibDirs.append(begin(RISCV64LibDirs), end(RISCV64LibDirs));
++      TripleAliases.append(begin(RISCV64MuslTriples), end(RISCV64MuslTriples));
++      break;
++    default:
++      break;
++    }
++    TripleAliases.push_back(TargetTriple.str());
++    if (TargetTriple.str() != BiarchTriple.str())
++      BiarchTripleAliases.push_back(BiarchTriple.str());
++    return;
++  }
++
+   // Android targets should not use GNU/Linux tools or libraries.
+   if (TargetTriple.isAndroid()) {
+     static const char *const AArch64AndroidTriples[] = {
diff --git a/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
new file mode 100644
index 000000000000..4ad6412d1e6c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-003-ppc64-dynamic-linker-path.patch
@@ -0,0 +1,13 @@
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -504,10 +504,6 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
+     Loader = "ld.so.1";
+     break;
+   case llvm::Triple::ppc64:
+-    LibDir = "lib64";
+-    Loader =
+-        (tools::ppc::hasPPCAbiArg(Args, "elfv2")) ? "ld64.so.2" : "ld64.so.1";
+-    break;
+   case llvm::Triple::ppc64le:
+     LibDir = "lib64";
+     Loader =
diff --git a/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
new file mode 100644
index 000000000000..21fc8003c5f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/clang-004-ppc64-musl-elfv2.patch
@@ -0,0 +1,48 @@
+--- a/clang/lib/Basic/Targets/PPC.h
++++ b/clang/lib/Basic/Targets/PPC.h
+@@ -415,11 +415,10 @@ public:
+       LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+     } else if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+       DataLayout = "e-m:e-i64:64-n32:64";
+-      ABI = "elfv2";
+     } else {
+       DataLayout = "E-m:e-i64:64-n32:64";
+-      ABI = "elfv1";
+     }
++    ABI = "elfv2";
+ 
+     if (Triple.isOSFreeBSD() || Triple.isOSOpenBSD() || Triple.isMusl()) {
+       LongDoubleWidth = LongDoubleAlign = 64;
+--- a/clang/lib/CodeGen/TargetInfo.cpp
++++ b/clang/lib/CodeGen/TargetInfo.cpp
+@@ -10927,9 +10927,9 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() {
+       return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true));
+ 
+     if (Triple.isOSBinFormatELF()) {
+-      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;
+-      if (getTarget().getABI() == "elfv2")
+-        Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv2;
++      if (getTarget().getABI() == "elfv1")
++        Kind = PPC64_SVR4_ABIInfo::ELFv1;
+       bool IsSoftFloat = CodeGenOpts.FloatABI == "soft";
+ 
+       return SetCGInfo(
+--- a/clang/lib/Driver/ToolChains/Clang.cpp
++++ b/clang/lib/Driver/ToolChains/Clang.cpp
+@@ -1920,14 +1920,7 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
+   const llvm::Triple &T = getToolChain().getTriple();
+   if (T.isOSBinFormatELF()) {
+     switch (getToolChain().getArch()) {
+-    case llvm::Triple::ppc64: {
+-      if ((T.isOSFreeBSD() && T.getOSMajorVersion() >= 13) ||
+-          T.isOSOpenBSD() || T.isMusl())
+-        ABIName = "elfv2";
+-      else
+-        ABIName = "elfv1";
+-      break;
+-    }
++    case llvm::Triple::ppc64:
+     case llvm::Triple::ppc64le:
+       ABIName = "elfv2";
+       break;
diff --git a/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
new file mode 100644
index 000000000000..360cfc1ba7f1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/compiler-rt-sanitizer-ppc64-musl.patch
@@ -0,0 +1,35 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+@@ -74,6 +74,10 @@
+ #include <sys/utsname.h>
+ #endif
+ 
++#if SANITIZER_LINUX && defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+ #include <sys/personality.h>
+ #endif
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -94,7 +94,7 @@
+ # include <utime.h>
+ # include <sys/ptrace.h>
+ #    if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+-        defined(__hexagon__) || SANITIZER_RISCV64
++        defined(__hexagon__) || defined(__powerpc__) || SANITIZER_RISCV64
+ #      include <asm/ptrace.h>
+ #      ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,7 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
++#if (defined(__aarch64__) || defined(__powerpc__) || SANITIZER_RISCV64) && !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-armv67.patch b/srcpkgs/llvm15/patches/libcxx-armv67.patch
new file mode 100644
index 000000000000..1dab312c83e3
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-armv67.patch
@@ -0,0 +1,22 @@
+See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109180
+Avoid the following undefined reference:
+
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__x() const [clone .localalias]':
+locale.cpp:(.text._ZNKSt3__120__time_get_c_storageIcE3__xEv+0xb4): undefined reference to `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()'
+/usr/lib/gcc/armv7l-linux-gnueabihf/12.2.0/../../../../armv7l-linux-gnueabihf/bin/ld: projects/libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: in function `std::__1::__time_get_c_storage<char>::__X() const [clone .localalias]':
+
+--- a/libcxx/src/CMakeLists.txt
++++ b/libcxx/src/CMakeLists.txt
+@@ -155,6 +155,12 @@ if (LIBCXX_GENERATE_COVERAGE AND NOT LIB
+ endif()
+ add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
+ 
++set(VOID_GCC_BUG_109180_WORKAROUND OFF CACHE BOOL "")
++
++if (VOID_GCC_BUG_109180_WORKAROUND)
++  set_source_files_properties(string.cpp PROPERTIES COMPILE_FLAGS -fno-inline)
++endif()
++
+ if (APPLE AND LLVM_USE_SANITIZER)
+   if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
+       ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
diff --git a/srcpkgs/llvm15/patches/libcxx-musl.patch b/srcpkgs/llvm15/patches/libcxx-musl.patch
new file mode 100644
index 000000000000..bbd31ffc2cb1
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-musl.patch
@@ -0,0 +1,26 @@
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -742,7 +742,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        long long __ll = strtoll(__a, &__p2, __base);
++#else
+         long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -782,7 +786,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         typename remove_reference<decltype(errno)>::type __save_errno = errno;
+         errno = 0;
+         char *__p2;
++#if defined(__linux__) && !defined(__GLIBC__)
++        unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+         unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+         typename remove_reference<decltype(errno)>::type __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
diff --git a/srcpkgs/llvm15/patches/libcxx-ppc.patch b/srcpkgs/llvm15/patches/libcxx-ppc.patch
new file mode 100644
index 000000000000..7a92f8004e1c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ppc.patch
@@ -0,0 +1,22 @@
+This ensures `is_iec559` is defined correctly under all long double ABIs,
+including musl and its 64-bit long double. Also, `__ppc__` or `__ppc64__`
+is not defined on gcc.
+
+--- a/libcxx/include/limits
++++ b/libcxx/include/limits
+@@ -426,8 +426,14 @@ protected:
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");}
+     _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;}
+ 
+-#if (defined(__ppc__) || defined(__ppc64__))
++#if defined(__powerpc__) || defined(__powerpc64__)
++#if (__LDBL_MAX_EXP__ > __DBL_MAX_EXP__) || (__LDBL_MANT_DIG__ == __DBL_MANT_DIG__)
++    /* IEEE 754 quadruple or double precision */
++    static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
++#else
++    /* 128-bit IBM double-double */
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
++#endif
+ #else
+     static _LIBCPP_CONSTEXPR const bool is_iec559 = true;
+ #endif
diff --git a/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxx-ssp-nonshared.patch
@@ -0,0 +1,11 @@
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -769,6 +769,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PRIVATE atomic)
+   endif()
+ 
++#ssp  target_link_libraries(${target} PRIVATE ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}")
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-dl.patch b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-dl.patch
@@ -0,0 +1,25 @@
+Also link to -ldl to prevent undefined references.
+
+--- a/libcxxabi/src/CMakeLists.txt
++++ b/libcxxabi/src/CMakeLists.txt
+@@ -73,6 +73,7 @@
+   endif()
+ 
+   add_library_flags_if(LIBCXXABI_HAS_C_LIB c)
++  add_library_flags_if(LIBCXXABI_HAS_C_LIB dl)
+ endif()
+ 
+ if (LIBCXXABI_USE_LLVM_UNWINDER)
+--- a/libcxx/CMakeLists.txt
++++ b/libcxx/CMakeLists.txt
+@@ -745,6 +745,10 @@
+     target_link_libraries(${target} PRIVATE m)
+   endif()
+ 
++  if (LIBCXX_HAS_C_LIB)
++    target_link_libraries(${target} PRIVATE dl)
++  endif()
++
+   if (LIBCXX_HAS_RT_LIB)
+     target_link_libraries(${target} PRIVATE rt)
+   endif()
diff --git a/srcpkgs/llvm15/patches/libcxxabi-musl.patch b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..000c3b1c0c7b
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libcxxabi-musl.patch
@@ -0,0 +1,40 @@
+gcc does not support using abi_tag in an extern "C" declaration:
+https://github.com/gcc-mirror/gcc/blob/cf59c8983ef6590f0d69014f8dc8778b5b7691c6/gcc/cp/tree.cc#L5354-L5359
+
+diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h
+index e674a41fa..f546119b9 100644
+--- a/libcxx/include/__support/musl/xlocale.h
++++ b/libcxx/include/__support/musl/xlocale.h
+@@ -24,27 +24,27 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long long
++static inline long long
+ wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI unsigned long long
++static inline unsigned long long
+ wcstoull_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) {
+   return ::wcstoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI long double
++static inline long double
+ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
diff --git a/srcpkgs/llvm15/patches/libomp-soname.patch b/srcpkgs/llvm15/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm15/patches/libomp-soname.patch
@@ -0,0 +1,12 @@
+diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
+index df1ca9d90..9d2c3b7b9 100644
+--- a/openmp/runtime/src/CMakeLists.txt
++++ b/openmp/runtime/src/CMakeLists.txt
+@@ -150,6 +150,7 @@ libomp_get_libflags(LIBOMP_CONFIGURED_LIBFLAGS)
+ # Build libomp library. Add LLVMSupport dependency if building in-tree with libomptarget profiling enabled.
+ if(OPENMP_STANDALONE_BUILD OR (NOT OPENMP_ENABLE_LIBOMP_PROFILING))
+   add_library(omp ${LIBOMP_LIBRARY_KIND} ${LIBOMP_SOURCE_FILES})
++  set_target_properties(omp PROPERTIES VERSION ${LIBOMP_VERSION_MAJOR} SOVERSION ${LIBOMP_VERSION_MAJOR})
+   # Linking command will include libraries in LIBOMP_CONFIGURED_LIBFLAGS
+   target_link_libraries(omp ${LIBOMP_CONFIGURED_LIBFLAGS} ${LIBOMP_DL_LIBS})
+ else()
diff --git a/srcpkgs/llvm15/patches/lldb-musl.patch b/srcpkgs/llvm15/patches/lldb-musl.patch
new file mode 100644
index 000000000000..026c5e1e61ba
--- /dev/null
+++ b/srcpkgs/llvm15/patches/lldb-musl.patch
@@ -0,0 +1,40 @@
+--- a/lldb/source/Plugins/Process/Linux/Procfs.h
++++ b/lldb/source/Plugins/Process/Linux/Procfs.h
+@@ -10,6 +10,7 @@
+ // sys/procfs.h on Android/Linux for all supported architectures.
+ 
+ #include <sys/ptrace.h>
++#include <asm/ptrace.h>
+ 
+ #include "lldb/lldb-types.h"
+ 
+@@ -17,23 +18,13 @@
+ 
+ #include <vector>
+ 
+-#ifdef __ANDROID__
+-#if defined(__arm64__) || defined(__aarch64__)
+-typedef unsigned long elf_greg_t;
+-typedef elf_greg_t
+-    elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))];
+-typedef struct user_fpsimd_state elf_fpregset_t;
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#elif defined(__mips__)
+-#ifndef NT_FPREGSET
+-#define NT_FPREGSET NT_PRFPREG
+-#endif // NT_FPREGSET
+-#endif
+-#else // __ANDROID__
++#if !defined(__GLIBC__) && defined(__powerpc__)
++#define pt_regs musl_pt_regs
++#include <sys/procfs.h>
++#undef pt_regs
++#else
+ #include <sys/procfs.h>
+-#endif // __ANDROID__
++#endif
+ 
+ namespace lldb_private {
+ namespace process_linux {
diff --git a/srcpkgs/llvm15/patches/llvm-001-musl.patch b/srcpkgs/llvm15/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..f2a3f8d62813
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-001-musl.patch
@@ -0,0 +1,57 @@
+From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
+From: Andrea Brancaleoni <miwaxe@gmail.com>
+Date: Tue, 8 Sep 2015 22:03:02 +0200
+Subject: [PATCH 3/3] musl
+
+---
+ include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
+ lib/Support/DynamicLibrary.cpp            | 2 +-
+ lib/Support/Unix/Signals.inc              | 6 +++---
+ utils/unittest/googletest/src/gtest.cc    | 1 +
+ 5 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
+index 34a8a1e3..1214ece5 100644
+--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
++++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+@@ -18,6 +18,15 @@
+ #include "llvm/IR/PassManager.h"
+ #include "llvm/Pass.h"
+ 
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ template <typename T> class ArrayRef;
+ class Triple;
+diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc
+index a2a37996..2f86c470 100644
+--- a/llvm/lib/Support/Unix/DynamicLibrary.inc
++++ b/llvm/lib/Support/Unix/DynamicLibrary.inc
+@@ -102,7 +102,7 @@ static void *DoSearch(const char* SymbolName) {
+ 
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+-   if (!strcmp(SymbolName, #SYM)) return &SYM
++   if (!strcmp(SymbolName, #SYM)) return (void *)&SYM
+ 
+ // Under glibc we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/llvm/utils/unittest/googletest/src/gtest.cc
++++ b/llvm/utils/unittest/googletest/src/gtest.cc
+@@ -128,6 +128,7 @@
+ 
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h>  // NOLINT
++# include <sys/socket.h>  // NOLINT
+ # include <netdb.h>  // NOLINT
+ # include <sys/socket.h>  // NOLINT
+ # include <sys/types.h>  // NOLINT
diff --git a/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
new file mode 100644
index 000000000000..0071d964bd37
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-002-musl-ppc64-elfv2.patch
@@ -0,0 +1,30 @@
+This patches LLVM to use ELFv2 on ppc64 unconditionally unless overridden. We
+need this because unlike most distros we use ELFv2 for both glibc and musl
+on big endian ppc64.
+
+diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
+index 0634833e..b7cbc2e7 100644
+--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
++++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -222,9 +222,8 @@ static PPCTargetMachine::PPCABI computeTargetABI(const Triple &TT,
+ 
+   switch (TT.getArch()) {
+   case Triple::ppc64le:
+-    return PPCTargetMachine::PPC_ABI_ELFv2;
+   case Triple::ppc64:
+-    return PPCTargetMachine::PPC_ABI_ELFv1;
++    return PPCTargetMachine::PPC_ABI_ELFv2;
+   default:
+     return PPCTargetMachine::PPC_ABI_UNKNOWN;
+   }
+diff --git a/test/CodeGen/PowerPC/ppc64-elf-abi.ll b/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+index 8b1cf6b5..296a2afa 100644
+--- a/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
++++ b/llvm/test/CodeGen/PowerPC/ppc64-elf-abi.ll
+@@ -1,4 +1,5 @@
+-; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv1
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
++; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-musl < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv1 < %s | FileCheck %s -check-prefix=CHECK-ELFv1
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -target-abi elfv2 < %s | FileCheck %s -check-prefix=CHECK-ELFv2
+ ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s -check-prefix=CHECK-ELFv2
diff --git a/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
new file mode 100644
index 000000000000..b5d15974375d
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-003-ppc-secureplt.patch
@@ -0,0 +1,11 @@
+--- a/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
++++ b/llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+@@ -165,7 +165,7 @@ void PPCSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
+ 
+   if ((TargetTriple.isOSFreeBSD() && TargetTriple.getOSMajorVersion() >= 13) ||
+       TargetTriple.isOSNetBSD() || TargetTriple.isOSOpenBSD() ||
+-      TargetTriple.isMusl())
++      isTargetLinux())
+     SecurePlt = true;
+ 
+   if (HasSPE && IsPPC64)
diff --git a/srcpkgs/llvm15/patches/llvm-004-override-opt.patch b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-004-override-opt.patch
@@ -0,0 +1,18 @@
+This allows us to override the optimization level as not all platforms can
+deal with -O3.
+
+--- a/llvm/CMakeLists.txt
++++ b/llvm/CMakeLists.txt
+@@ -918,6 +918,12 @@ if( MINGW AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
+   llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ endif()
+ 
++set(VOID_CXX_OPT_FLAGS "" CACHE STRING "Optimization level to use")
++
++if (NOT VOID_CXX_OPT_FLAGS STREQUAL "")
++    llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "${VOID_CXX_OPT_FLAGS}")
++endif()
++
+ # Put this before tblgen. Else we have a circular dependence.
+ add_subdirectory(lib/Demangle)
+ add_subdirectory(lib/Support)
diff --git a/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-005-ppc-bigpic.patch
@@ -0,0 +1,36 @@
+From f3dbdd49c06bfafc1d6138094cf42889c14d38b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 3 Nov 2019 10:57:27 -0600
+Subject: [PATCH] [LLVM][PowerPC] Assume BigPIC if no PIC level is specified
+
+---
+ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp  | 2 +-
+ llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
+index cce21f32..87ca5f9b 100644
+--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
++++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+@@ -520,7 +520,7 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
+ 
+   // Add 32768 offset to the symbol so we follow up the latest GOT/PLT ABI.
+   if (Kind == MCSymbolRefExpr::VK_PLT && Subtarget->isSecurePlt() &&
+-      M->getPICLevel() == PICLevel::BigPIC)
++      M->getPICLevel() != PICLevel::SmallPIC)
+     TlsRef = MCBinaryExpr::createAdd(
+         TlsRef, MCConstantExpr::create(32768, OutContext), OutContext);
+   const MachineOperand &MO = MI->getOperand(2);
+diff --git a/lib/Target/PowerPC/PPCMCInstLower.cpp b/lib/Target/PowerPC/PPCMCInstLower.cpp
+index 5cc180d7..a5b02565 100644
+--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
++++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+@@ -117,7 +117,7 @@ static MCOperand GetSymbolRef(const MachineOperand &MO, const MCSymbol *Symbol,
+   const MCExpr *Expr = MCSymbolRefExpr::create(Symbol, RefKind, Ctx);
+   // If -msecure-plt -fPIC, add 32768 to symbol.
+   if (Subtarget->isSecurePlt() && TM.isPositionIndependent() &&
+-      M->getPICLevel() == PICLevel::BigPIC &&
++      M->getPICLevel() != PICLevel::SmallPIC &&
+       MO.getTargetFlags() == PPCII::MO_PLT)
+     Expr =
+         MCBinaryExpr::createAdd(Expr, MCConstantExpr::create(32768, Ctx), Ctx);
diff --git a/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
new file mode 100644
index 000000000000..a00abd216665
--- /dev/null
+++ b/srcpkgs/llvm15/patches/llvm-006-aarch64-mf_exec.patch
@@ -0,0 +1,25 @@
+Fix failures in AllocationTests/MappedMemoryTest.* on aarch64:
+
+    Failing Tests (8):
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.AllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.DuplicateNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.EnabledWrite/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.MultipleAllocAndRelease/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.SuccessiveNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.UnalignedNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroNear/3
+        LLVM-Unit :: Support/./SupportTests/AllocationTests/MappedMemoryTest.ZeroSizeNear/3
+
+Upstream-Issue: https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -58,7 +58,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+ #if (defined(__FreeBSD__) || defined(__POWERPC__) || defined (__ppc__) || \
+-     defined(_POWER) || defined(_ARCH_PPC))
++     defined(_POWER) || defined(_ARCH_PPC) || (defined(__linux__) && defined(__aarch64__)))
+     // On PowerPC, having an executable page that has no read permission
+     // can have unintended consequences.  The function InvalidateInstruction-
+     // Cache uses instructions dcbf and icbi, both of which are treated by
diff --git a/srcpkgs/llvm15/template b/srcpkgs/llvm15/template
new file mode 100644
index 000000000000..cf7bde85e40d
--- /dev/null
+++ b/srcpkgs/llvm15/template
@@ -0,0 +1,451 @@
+# Template file for 'llvm15'
+pkgname=llvm15
+version=15.0.7
+revision=1
+build_wrksrc=llvm
+build_style=cmake
+_ext_suffix=".cpython-${py3_ver/./}-linux-${XBPS_TARGET_LIBC/glibc/gnu}.so"
+configure_args="
+ -DCMAKE_BUILD_TYPE=Release -Wno-dev
+ -DENABLE_LINKER_BUILD_ID=YES
+ -DLLDB_USE_SYSTEM_SIX=YES
+ -DLIBCXX_CXX_ABI=libcxxabi
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLLVM_INCLUDE_DOCS=YES
+ -DLLVM_BUILD_DOCS=YES
+ -DLLVM_ENABLE_SPHINX=YES
+ -DSPHINX_WARNINGS_AS_ERRORS=NO
+ -DLLVM_INSTALL_UTILS=YES
+ -DLLVM_BUILD_LLVM_DYLIB=YES
+ -DLLVM_LINK_LLVM_DYLIB=YES
+ -DLLVM_ENABLE_RTTI=YES
+ -DLLVM_ENABLE_FFI=YES
+ -DLLVM_BINUTILS_INCDIR=/usr/include
+ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=NO
+ -DLLDB_PYTHON_RELATIVE_PATH=lib/python${py3_ver}/site-packages
+ -DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
+ -DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
+hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
+ python3-recommonmark python3-sphinx-automodapi"
+makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
+ libxml2-devel binutils-devel libatomic-devel"
+depends="libllvm15>=${version}_${revision}"
+short_desc="Low Level Virtual Machine"
+maintainer="Orphaned <orphan@voidlinux.org>"
+license="Apache-2.0"
+homepage="https://www.llvm.org"
+distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-project-${version}.src.tar.xz"
+checksum=8b5fcb24b4128cf04df1b0b9410ce8b1a729cb3c544e6da885d234280dedeac6
+lib32disabled=yes
+python_version=3
+
+if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+	configure_args+=" -DLIBCXX_HAS_MUSL_LIBC=YES
+	 -DCOMPILER_RT_BUILD_GWP_ASAN=OFF"
+fi
+
+# "operand out of range" assembler failures
+case "$XBPS_TARGET_MACHINE" in
+	ppc64*) ;;
+	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
+esac
+
+_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
+
+_lldb_enable=yes
+_libomp_enable=no
+
+case "$XBPS_TARGET_MACHINE" in
+	ppc64le*) ;;
+	ppc*|i686*|riscv64*) _lldb_enable=no ;;
+esac
+
+case "$XBPS_TARGET_MACHINE" in
+	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
+esac
+
+subpackages="clang-tools-extra"
+
+# must go before clang
+if [ "$_libomp_enable" = "yes" ]; then
+	_enabled_projects+=";openmp"
+	subpackages+=" libomp libomp-devel"
+	# because of cmake nonsense referencing libomptarget.so.*
+	depends+=" libomp>=${version}_${revision}"
+	if [ "$CROSS_BUILD" ]; then
+		# Seems to require a full host llvm/clang build
+		configure_args+=" -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF"
+		configure_args+=" -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF"
+	fi
+fi
+
+subpackages+=" clang clang-analyzer libclang libclang-cpp
+ llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
+ libcxxabi libcxxabi-devel libllvm15"
+
+if [ "$_lldb_enable" = "yes" ]; then
+	# XXX fails to cross compile due to python
+	_enabled_projects+=";lldb"
+	subpackages+=" lldb lldb-devel"
+fi
+
+subpackages+=" lld lld-devel"
+
+configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
+
+post_patch() {
+	if [ "$_lldb_enable" = "yes" ]; then
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			vsed -i 's|__ptrace_request|int|g' \
+				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+		fi
+		# disable docs for lldb as they fail to generate
+		vsed -i '/add_subdirectory(docs)/d' \
+			${wrksrc}/lldb/CMakeLists.txt
+	fi
+
+	# update config.guess for better platform detection
+	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
+		${wrksrc}/llvm/cmake
+
+	# fix linker failures on some archs
+	vsed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+	vsed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+		${wrksrc}/libcxxabi/cmake/config-ix.cmake
+
+	# need libssp_nonshared on some musl platforms (because of nodefaultlibs)
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		ppc*-musl|i686-musl|mips*-musl)
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libunwind/src/CMakeLists.txt
+			vsed -i 's,^# Setup flags.$,add_library_flags(ssp_nonshared),' \
+				${wrksrc}/libcxxabi/src/CMakeLists.txt
+			vsed -i 's,#ssp,,' ${wrksrc}/libcxx/CMakeLists.txt
+			;;
+	esac
+
+	case "$XBPS_TARGET_MACHINE" in
+		arm*-musl|i686-musl) # sanitizer code is broken since it duplicates some libc bits
+			vsed -i 's/set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)/set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE)/' \
+				${wrksrc}/compiler-rt/cmake/config-ix.cmake
+			;;
+	esac
+}
+
+pre_configure() {
+	local triplet
+
+	# Vastly reduce size of debugging symbols:
+	CFLAGS=${CFLAGS/ -g/ -g1}
+	CXXFLAGS=${CXXFLAGS/ -g/ -g1}
+
+	# since gcc9, the build likes to blow up for ppc32 apparently because
+	# of clang being too large for a 24-bit relative call to the PLT, so
+	# optimize for size instead
+	case "$XBPS_TARGET_MACHINE" in
+		ppc64*) ;;
+		mips*-musl|ppc*) configure_args+=" -DVOID_CXX_OPT_FLAGS=-Os" ;;
+		armv*) configure_args+=" -DVOID_GCC_BUG_109180_WORKAROUND=ON" ;;
+	esac
+
+	if [ "$CROSS_BUILD" ]; then
+		msg_normal "Building host tblgen\n"
+		mkdir -p build/HOST
+		cd build/HOST
+		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
+			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
+			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+		make ${makejobs} -C utils/TableGen
+		make ${makejobs} -C tools/clang/utils/TableGen
+		make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
+		make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
+		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
+		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
+		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
+		configure_args+=" -DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${wrksrc}/llvm/build/HOST/bin/clang-tidy-confusable-chars-gen"
+		configure_args+=" -DCLANG_PSEUDO_GEN=${wrksrc}/llvm/build/HOST/bin/clang-pseudo-gen"
+		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
+		cd ../..
+	fi
+
+	case "$XBPS_TARGET_MACHINE" in
+		i686*) _arch="X86";;
+		x86_64*) _arch="X86";;
+		armv5*) _arch="Armv5te";;
+		armv6*) _arch="Armv6";;
+		armv7*) _arch="Armv7";;
+		aarch64*) _arch="AArch64";;
+		mips*) _arch="Mips";;
+		ppc*) _arch="PowerPC";;
+		riscv64*) _arch="RISCV64";;
+	esac
+
+	triplet=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}
+
+	configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
+	configure_args+=" -DLLVM_HOST_TRIPLE=${triplet}"
+	configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${triplet}"
+}
+
+do_install() {
+	cd build
+	cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
+
+	# Required for multilib.
+	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
+		for _header in llvm-config; do
+			mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
+			vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
+				usr/include/llvm/Config ${_header}.h
+		done
+	fi
+
+	# Remove llvm-config-host in cross builds.
+	if [ "$CROSS_BUILD" ]; then
+		rm -f ${DESTDIR}/usr/bin/llvm-config-host
+	fi
+
+	# Install libcxxabi headers
+	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
+	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
+
+	# Install libunwind headers
+	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
+	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
+		644 usr/include/mach-o
+}
+
+clang-analyzer_package() {
+	pycompile_dirs="usr/share/scan-view"
+	depends="clang-${version}_${revision} python3 perl"
+	short_desc+=" - A source code analysis framework"
+	homepage="https://clang-analyzer.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/scan-*"
+		vmove "usr/libexec/*analyzer"
+		vmove "usr/share/scan-*"
+		vmove usr/share/man/man1/scan-build.1
+	}
+}
+
+clang-tools-extra_package() {
+	lib32disabled=yes
+	depends="clang-${version}_${revision} python3"
+	short_desc+=" - Extra Clang tools"
+	homepage="https://clang.llvm.org/extra/"
+	pkg_install() {
+		vmove usr/bin/clang-apply-replacements
+		vmove usr/bin/clang-change-namespace
+		vmove usr/bin/clang-doc
+		vmove usr/bin/clang-include-fixer
+		vmove usr/bin/clang-move
+		vmove usr/bin/clang-pseudo
+		vmove usr/bin/clang-query
+		vmove usr/bin/clang-reorder-fields
+		vmove usr/bin/clang-tidy
+		vmove usr/bin/clangd
+		vmove usr/bin/find-all-symbols
+		vmove usr/bin/hmaptool
+		vmove usr/bin/modularize
+		vmove usr/bin/pp-trace
+		vmove usr/include/clang-tidy
+		vmove "usr/lib/libclangApplyReplacements*"
+		vmove "usr/lib/libclangChangeNamespace*"
+		vmove "usr/lib/libclangDaemon*"
+		vmove "usr/lib/libclangDoc*"
+		vmove "usr/lib/libclangIncludeCleaner*"
+		vmove "usr/lib/libclangIncludeFixer*"
+		vmove "usr/lib/libclangMove*"
+		vmove "usr/lib/libclangPseudo*"
+		vmove "usr/lib/libclangReorderFields*"
+		vmove "usr/lib/libclangQuery*"
+		vmove "usr/lib/libclangTidy*"
+		vmove "usr/lib/libclangd*"
+		vmove "usr/lib/libfindAllSymbols*"
+		vmove "usr/share/clang/*find-all-symbols*"
+		vmove "usr/share/clang/*include-fixer*"
+		vmove "usr/share/clang/*tidy*"
+		vmove usr/share/doc/LLVM/clang-tools
+		vmove usr/share/man/man1/extraclangtools.1
+	}
+}
+
+clang_package() {
+	lib32disabled=yes
+	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
+	 libclang-${version}_${revision}"
+	short_desc+=" - C language family frontend"
+	homepage="https://clang.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*clang*"
+		vmove usr/bin/c-index-test
+		vmove usr/bin/diagtool
+		vmove usr/include/clang
+		vmove usr/include/clang-c
+		vmove usr/lib/clang
+		vmove usr/lib/cmake/clang
+		vmove "usr/lib/libclang*.a"
+		vmove "usr/lib/libclang*.so"
+		vmove usr/share/clang
+		vmove usr/share/doc/LLVM/clang
+		vmove usr/share/man/man1/clang.1
+		vmove usr/share/man/man1/diagtool.1
+	}
+}
+
+libclang_package() {
+	short_desc+=" - C frontend runtime library"
+	pkg_install() {
+		vmove "usr/lib/libclang.so.*"
+	}
+}
+
+libclang-cpp_package() {
+	short_desc+=" - C frontend runtime library (C++ interface)"
+	pkg_install() {
+		vmove "usr/lib/libclang-cpp.so.*"
+	}
+}
+
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - linker"
+	homepage="https://lld.llvm.org"
+	pkg_install() {
+		vmove "usr/bin/ld.lld*"
+		vmove "usr/bin/ld64.lld*"
+		vmove "usr/bin/lld*"
+		vmove usr/bin/wasm-ld
+		vmove usr/share/doc/LLVM/lld
+	}
+}
+
+lld-devel_package() {
+	lib32disabled=yes
+	short_desc+=" - linker - development files"
+	homepage="https://lld.llvm.org"
+	depends="lld>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/lib/cmake/lld
+		vmove "usr/lib/liblld*a"
+	}
+}
+
+lldb_package() {
+	lib32disabled=yes
+	depends+=" python3-six"
+	short_desc+=" - LLDB debugger"
+	homepage="https://lldb.llvm.org/"
+	pkg_install() {
+		vmove "usr/bin/*lldb*"
+		vmove "usr/lib/liblldb*so.*"
+		vmove usr/lib/python*
+	}
+}
+
+lldb-devel_package() {
+	lib32disabled=yes
+	depends="lldb>=${version}_${revision}"
+	short_desc+=" - LLDB debugger - development files"
+	pkg_install() {
+		vmove usr/include/lldb
+		vmove "usr/lib/liblldb*.so"
+	}
+}
+
+llvm-libunwind_package() {
+	short_desc+=" - libunwind"
+	pkg_install() {
+		vmove "usr/lib/libunwind.so.*"
+	}
+}
+
+llvm-libunwind-devel_package() {
+	short_desc+=" - libunwind - development files"
+	depends="llvm-libunwind>=${version}_${revision}"
+	conflicts="libunwind-devel>=0"
+	pkg_install() {
+		vmove usr/include/mach-o
+		vmove "usr/include/*unwind*"
+		vmove "usr/lib/libunwind.a"
+		vmove "usr/lib/libunwind.so"
+		vmove usr/share/doc/LLVM/libunwind
+	}
+}
+
+libcxxabi_package() {
+	short_desc+=" - low level support for libc++"
+	pkg_install() {
+		vmove "usr/lib/libc++abi.so.*"
+	}
+}
+
+libcxxabi-devel_package() {
+	short_desc+=" - low level support for libc++ - development files"
+	depends="libcxxabi>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/*cxxabi*"
+		vmove "usr/lib/libc++abi.so"
+		vmove "usr/lib/libc++abi.a"
+	}
+}
+
+libcxx_package() {
+	short_desc+=" - C++ standard library"
+	pkg_install() {
+		vmove "usr/lib/libc++.so.*"
+	}
+}
+
+libcxx-devel_package() {
+	short_desc+=" - C++ standard library - development files"
+	depends="libcxx>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/c++
+		vmove "usr/lib/libc++.so"
+		vmove "usr/lib/libc++.a"
+		vmove "usr/lib/libc++experimental.a"
+		vmove usr/share/doc/LLVM/libcxx
+	}
+}
+
+libomp_package() {
+	short_desc+=" - Clang OpenMP support library"
+	pkg_install() {
+		vmove usr/lib/libarcher.so
+		vmove usr/lib/libompd.so
+		vmove "usr/lib/libomptarget.rtl.*.so"
+		vmove "usr/lib/libomp*.so.*"
+	}
+}
+
+libomp-devel_package() {
+	short_desc+=" - Clang OpenMP support library - development files"
+	depends="libomp>=${version}_${revision}"
+	pkg_install() {
+		vmove "usr/include/omp*.h"
+		vmove "usr/lib/clang/${version}/include/omp*.h"
+		vmove "usr/lib/libarcher*"
+		vmove "usr/lib/libomp*.so"
+		vmove usr/lib/cmake/openmp
+		vmove usr/share/doc/LLVM/openmp
+		vmove usr/share/man/man1/llvmopenmp.1
+	}
+}
+
+libllvm15_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm15/update b/srcpkgs/llvm15/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm15/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From 3b5c2752730791cacddb958d9ab5f31738fd40dd Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 00:40:18 +0100
Subject: [PATCH 02/26] llvm: update to 15

---
 common/shlibs                | 6 +++---
 srcpkgs/clang                | 2 +-
 srcpkgs/clang-analyzer       | 2 +-
 srcpkgs/clang-tools-extra    | 2 +-
 srcpkgs/libclang             | 2 +-
 srcpkgs/libclang-cpp         | 2 +-
 srcpkgs/libcxx               | 2 +-
 srcpkgs/libcxx-devel         | 2 +-
 srcpkgs/libcxxabi            | 2 +-
 srcpkgs/libcxxabi-devel      | 2 +-
 srcpkgs/libomp               | 2 +-
 srcpkgs/libomp-devel         | 2 +-
 srcpkgs/lld                  | 2 +-
 srcpkgs/lld-devel            | 2 +-
 srcpkgs/lldb                 | 2 +-
 srcpkgs/lldb-devel           | 2 +-
 srcpkgs/llvm-libunwind       | 2 +-
 srcpkgs/llvm-libunwind-devel | 2 +-
 srcpkgs/llvm/template        | 6 +++---
 19 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 0f4f21cef67d..590032cb545d 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -987,9 +987,9 @@ libuchardet.so.0 uchardet-0.0.6_1
 libgtksourceviewmm-3.0.so.0 gtksourceviewmm-3.2.0_1
 libyajl.so.2 yajl-2.0.1_1
 libconfuse.so.2 confuse-3.2.1_1
-liblldb.so.12 lldb-12.0.0_1
-libclang.so.12 libclang-12.0.0_1
-libclang-cpp.so.12 libclang-cpp-12.0.0_1
+liblldb.so.15 lldb-15.0.7_1
+libclang.so.15 libclang-15.0.7_1
+libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
diff --git a/srcpkgs/clang b/srcpkgs/clang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index cd60fd7a981b..ad57a969b9f9 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm12
\ No newline at end of file
+llvm15
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index a92db6f94f9f..fc1c850bd26f 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,11 +1,11 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=12.0.0
+version=15
 revision=1
 build_style=meta
-depends="llvm12"
-replaces="llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"
+depends="llvm15"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"
 homepage="https://www.voidlinux.org"
+replaces="llvm12>=0 llvm11>=0 llvm10>=0 llvm9>=0 llvm8>=0 llvm7>=0 llvm6.0>=0 llvm3.9>=0"

From 98d99254603c787600a100399af8ef50d904a90b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sun, 18 Dec 2022 12:20:08 +0100
Subject: [PATCH 03/26] llvm12: remove bumped subpackages

---
 srcpkgs/llvm12/template | 264 +---------------------------------------
 1 file changed, 1 insertion(+), 263 deletions(-)

diff --git a/srcpkgs/llvm12/template b/srcpkgs/llvm12/template
index f8ea3ba641ae..aea0b43cf573 100644
--- a/srcpkgs/llvm12/template
+++ b/srcpkgs/llvm12/template
@@ -50,55 +50,7 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
 esac
 
-_enabled_projects="clang;clang-tools-extra;compiler-rt;libcxx;libcxxabi;libunwind;lld"
-
-_lldb_enable=yes
-_libomp_enable=no
-
-case "$XBPS_TARGET_MACHINE" in
-	ppc64le*) ;;
-	ppc*|i686*) _lldb_enable=no ;;
-esac
-
-case "$XBPS_TARGET_MACHINE" in
-	x86_64*|aarch64*|ppc64*) _libomp_enable=yes;;
-esac
-
-subpackages="clang-tools-extra"
-
-# must go before clang
-if [ "$_libomp_enable" = "yes" ]; then
-	_enabled_projects+=";openmp"
-	subpackages+=" libomp libomp-devel"
-	# because of cmake nonsense referencing libomptarget.so.*
-	depends+=" libomp>=${version}_${revision}"
-fi
-
-subpackages+=" clang clang-analyzer libclang libclang-cpp
- llvm-libunwind llvm-libunwind-devel libcxx libcxx-devel
- libcxxabi libcxxabi-devel libllvm12"
-
-if [ "$_lldb_enable" = "yes" ]; then
-	# XXX fails to cross compile due to python
-	_enabled_projects+=";lldb"
-	subpackages+=" lldb lldb-devel"
-fi
-
-subpackages+=" lld lld-devel"
-
-configure_args+=" -DLLVM_ENABLE_PROJECTS=${_enabled_projects}"
-
 post_patch() {
-	if [ "$_lldb_enable" = "yes" ]; then
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			vsed -i 's|__ptrace_request|int|g' \
-				${wrksrc}/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
-		fi
-		# disable docs for lldb as they fail to generate
-		vsed -i '/add_subdirectory(docs)/d' \
-			${wrksrc}/lldb/CMakeLists.txt
-	fi
-
 	# update config.guess for better platform detection
 	cp $XBPS_COMMONDIR/environment/configure/automake/config.guess \
 		${wrksrc}/llvm/cmake
@@ -154,14 +106,12 @@ pre_configure() {
 		cd build/HOST
 		CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
 			CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
-			cmake ../.. -DCMAKE_BUILD_TYPE=Release \
-			-DLLVM_ENABLE_PROJECTS=${_enabled_projects}
+			cmake ../.. -DCMAKE_BUILD_TYPE=Release
 		make ${makejobs} -C utils/TableGen
 		make ${makejobs} -C tools/clang/utils/TableGen
 		[ "$_lldb_enable" = "yes" ] && make ${makejobs} -C tools/lldb/utils/TableGen
 		configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/llvm-tblgen"
 		configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/clang-tblgen"
-		[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
 		cd ../..
 	fi
 
@@ -201,218 +151,6 @@ do_install() {
 	if [ "$CROSS_BUILD" ]; then
 		rm -f ${DESTDIR}/usr/bin/llvm-config-host
 	fi
-
-	# Install libcxxabi headers
-	vinstall ${wrksrc}/libcxxabi/include/__cxxabi_config.h 644 usr/include
-	vinstall ${wrksrc}/libcxxabi/include/cxxabi.h 644 usr/include
-
-	# Install libunwind headers
-	vinstall ${wrksrc}/libunwind/include/__libunwind_config.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/libunwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/unwind.h 644 usr/include
-	vinstall ${wrksrc}/libunwind/include/mach-o/compact_unwind_encoding.h \
-		644 usr/include/mach-o
-}
-
-clang-analyzer_package() {
-	pycompile_dirs="usr/share/scan-view"
-	depends="clang-${version}_${revision} python3 perl"
-	short_desc+=" - A source code analysis framework"
-	homepage="https://clang-analyzer.llvm.org/"
-	pkg_install() {
-		vmove usr/share/man/man1/scan-build.1
-		vmove "/usr/bin/scan-*"
-		vmove "/usr/share/scan-*"
-		vmove "/usr/libexec/*analyzer"
-	}
-}
-
-clang-tools-extra_package() {
-	lib32disabled=yes
-	depends="clang-${version}_${revision} python3"
-	short_desc+=" - Extra Clang tools"
-	homepage="https://clang.llvm.org/extra/"
-	pkg_install() {
-		vmove usr/include/clang-tidy
-		vmove usr/bin/clang-apply-replacements
-		vmove usr/bin/clang-query
-		vmove usr/bin/clang-rename
-		vmove usr/bin/clang-tidy
-		vmove usr/bin/diagtool
-		vmove usr/bin/find-all-symbols
-		vmove usr/bin/hmaptool
-		vmove usr/bin/modularize
-		vmove usr/bin/pp-trace
-		vmove usr/bin/sancov
-		vmove "usr/lib/libclangApplyReplacements*"
-		vmove "usr/lib/libclangQuery*"
-		vmove "usr/lib/libclangTidy*"
-		vmove "usr/share/clang/*tidy*"
-		vmove usr/share/doc/clang-tools
-		vmove usr/share/man/man1/extraclangtools.1
-		vmove usr/share/man/man1/diagtool.1
-	}
-}
-
-clang_package() {
-	lib32disabled=yes
-	depends="libstdc++-devel libgcc-devel  binutils ${XBPS_TARGET_LIBC}-devel
-	 libclang-${version}_${revision}"
-	short_desc+=" - C language family frontend"
-	homepage="https://clang.llvm.org/"
-	pkg_install() {
-		vmove usr/include/clang
-		vmove usr/include/clang-c
-		vmove "usr/bin/*clang*"
-		vmove usr/bin/c-index-test
-		vmove usr/lib/clang
-		vmove usr/lib/cmake/clang
-		vmove "usr/lib/libclang*.a"
-		vmove "usr/lib/libclang*.so"
-		vmove usr/share/clang
-		vmove usr/share/doc/clang
-		vmove usr/share/man/man1/clang.1
-	}
-}
-
-libclang_package() {
-	short_desc+=" - C frontend runtime library"
-	pkg_install() {
-		vmove "usr/lib/libclang.so.*"
-	}
-}
-
-libclang-cpp_package() {
-	short_desc+=" - C frontend runtime library (C++ interface)"
-	pkg_install() {
-		vmove "usr/lib/libclang-cpp.so.*"
-	}
-}
-
-lld_package() {
-	lib32disabled=yes
-	short_desc+=" - linker"
-	homepage="https://lld.llvm.org"
-	pkg_install() {
-		vmove usr/bin/lld*
-		vmove usr/bin/wasm-ld
-		vmove usr/bin/ld.lld*
-		vmove usr/bin/ld64.lld*
-		vmove usr/share/doc/lld
-	}
-}
-
-lld-devel_package() {
-	lib32disabled=yes
-	short_desc+=" - linker - development files"
-	homepage="https://lld.llvm.org"
-	depends="lld>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include/lld
-		vmove usr/lib/cmake/lld
-		vmove "usr/lib/liblld*a"
-	}
-}
-
-lldb_package() {
-	lib32disabled=yes
-	depends+=" python3-six"
-	short_desc+=" - LLDB debugger"
-	homepage="https://lldb.llvm.org/"
-	pkg_install() {
-		vmove usr/bin/*lldb*
-		vmove usr/lib/liblldb*so.*
-		vmove /usr/lib/python*
-	}
-}
-
-lldb-devel_package() {
-	lib32disabled=yes
-	depends="lldb>=${version}_${revision}"
-	short_desc+=" - LLDB debugger - development files"
-	pkg_install() {
-		vmove usr/include/lldb
-		vmove "usr/lib/liblldb*.so"
-	}
-}
-
-llvm-libunwind_package() {
-	short_desc+=" - libunwind"
-	pkg_install() {
-		vmove "usr/lib/libunwind.so.*"
-	}
-}
-
-llvm-libunwind-devel_package() {
-	short_desc+=" - libunwind - development files"
-	depends="llvm-libunwind>=${version}_${revision}"
-	conflicts="libunwind-devel>=0"
-	pkg_install() {
-		vmove usr/lib/libunwind.so
-		vmove usr/lib/libunwind.a
-		vmove "usr/include/*unwind*"
-		vmove usr/include/mach-o
-		vmove usr/share/doc/libunwind
-	}
-}
-
-libcxxabi_package() {
-	short_desc+=" - low level support for libc++"
-	pkg_install() {
-		vmove "usr/lib/libc++abi.so.*"
-	}
-}
-
-libcxxabi-devel_package() {
-	short_desc+=" - low level support for libc++ - development files"
-	depends="libcxxabi>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++abi.so
-		vmove usr/lib/libc++abi.a
-		vmove "usr/include/*cxxabi*"
-	}
-}
-
-libcxx_package() {
-	short_desc+=" - C++ standard library"
-	pkg_install() {
-		vmove "usr/lib/libc++.so.*"
-	}
-}
-
-libcxx-devel_package() {
-	short_desc+=" - C++ standard library - development files"
-	depends="libcxx>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/lib/libc++.so
-		vmove usr/lib/libc++.a
-		vmove usr/lib/libc++experimental.a
-		vmove usr/include/c++
-		vmove usr/share/doc/libcxx
-	}
-}
-
-libomp_package() {
-	short_desc+=" - Clang OpenMP support library"
-	pkg_install() {
-		vmove usr/lib/libomp.so
-		vmove "usr/lib/libomptarget.rtl.*.so"
-		vmove usr/lib/libarcher.so
-		vmove "usr/lib/libomp*.so.*"
-	}
-}
-
-libomp-devel_package() {
-	short_desc+=" - Clang OpenMP support library - development files"
-	depends="libomp>=${version}_${revision}"
-	pkg_install() {
-		vmove "usr/lib/libomp*.so"
-		vmove "usr/lib/libarcher*"
-		vmove "usr/include/omp*.h"
-		vmove "usr/lib/clang/${version}/include/omp*.h"
-		vmove usr/share/man/man1/llvmopenmp.1
-		vmove usr/share/doc/openmp
-	}
 }
 
 libllvm12_package() {

From 7c0c6706d18746b09d8f51e23eadaa31db1e9d55 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 15:11:06 +0100
Subject: [PATCH 04/26] SPIRV-LLVM-Translator: update to 15.0.0

---
 common/shlibs                          |  2 +-
 srcpkgs/SPIRV-LLVM-Translator/template | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 590032cb545d..88358c494779 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -993,7 +993,7 @@ libclang-cpp.so.15 libclang-cpp-15.0.7_1
 libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
-libLLVMSPIRVLib.so.12 SPIRV-LLVM-Translator-12.0.0_1
+libLLVMSPIRVLib.so.15 SPIRV-LLVM-Translator-15.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.15 libomp-15.0.7_1
 libisofs.so.6 libisofs-0.6.24_1
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index a2754e58c0e8..bee99f9bcbb2 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,19 +1,20 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=12.0.0
-revision=2
+version=15.0.0
+revision=1
 build_style=cmake
 make_build_args="llvm-spirv"
 configure_args="-Wno-dev -DLLVM_LINK_LLVM_DYLIB=ON -DCMAKE_SKIP_RPATH=ON
- -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON"
+ -DLLVM_SPIRV_INCLUDE_TESTS=OFF -DBUILD_SHARED_LIBS=ON
+ -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
 hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm"
+makedepends="clang-tools-extra llvm SPIRV-Headers"
 short_desc="API and commands for processing SPIR-V modules"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="NCSA"
 homepage="https://github.com/KhronosGroup/SPIRV-LLVM-Translator"
-distfiles="https://github.com/KhronosGroup/${pkgname}/archive/refs/tags/v${version}.tar.gz"
-checksum=6e4fad04203f25fcde4c308c53e9f59bd05a390978992db3212d4b63aff62108
+distfiles="https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
+checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
 
 post_install() {
 	vlicense LICENSE.TXT

From 902b6e18960a53b51e3e33ccf331dff02c858f4e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:27:03 +0100
Subject: [PATCH 05/26] mesa: rebuild for llvm15

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d9ff0b2ff23d..132263d3599f 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled

From 2834adede0a3fa89a26c60893030ba390e73cd12 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:34:04 +0100
Subject: [PATCH 06/26] bcc: rebuild for llvm15

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 7526580f17ed..bdbcff7227a0 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.26.0
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 091ad6059fe577708b14072e2e3d9bf83018bcff Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:37:25 +0100
Subject: [PATCH 07/26] bpftrace: rebuild for llvm15

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index 574930427ad1..eb8e37994498 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.0
-revision=2
+revision=3
 archs="x86_64* aarch64* ppc64*"
 build_style=cmake
 configure_args="-DUSE_SYSTEM_BPF_BCC=ON -DBUILD_TESTING=OFF" # needs root to run

From 8be88b06f3395607e6f5df3d47e092a3f7e6121c Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:43:53 +0100
Subject: [PATCH 08/26] CastXML: rebuild for llvm15

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index 00e82ac66b50..de0920900ae4 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.5.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"
@@ -12,7 +12,7 @@ short_desc="C-family abstract syntax tree XML output tool"
 maintainer="Evgeny Ermakov <evgeny.v.ermakov@gmail.com>"
 license="Apache-2.0"
 homepage="https://github.com/CastXML/CastXML"
-distfiles="https://github.com/CastXML/CastXML/archive/v${version}.tar.gz"
+distfiles="https://github.com/CastXML/CastXML/archive/refs/tags/v${version}.tar.gz"
 checksum=a7b40b1530585672f9cf5d7a6b6dd29f20c06cd5edf34ef34c89a184a4d1a006
 
 post_install() {

From 4ec7bcb2b243a60fe97a96060fac4fa027c320f4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:48:55 +0100
Subject: [PATCH 09/26] ccls: rebuild for llvm15

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

diff --git a/srcpkgs/ccls/template b/srcpkgs/ccls/template
index 82fa61933878..ecc9f3e38a5d 100644
--- a/srcpkgs/ccls/template
+++ b/srcpkgs/ccls/template
@@ -1,7 +1,7 @@
 # Template file for 'ccls'
 pkgname=ccls
 version=0.20220729
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="clang-tools-extra"
 makedepends="clang-tools-extra libxml2-devel llvm ncurses-devel rapidjson zlib-devel"

From 7aefdb5e45ab05ac89580a6d955c276596b5b6ab Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 5 Jan 2023 14:52:14 +0100
Subject: [PATCH 10/26] include-what-you-use: update to 0.19

---
 srcpkgs/include-what-you-use/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index d3655709c20c..1a30bc04bb2d 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,6 +1,6 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
-version=0.16
+version=0.19
 revision=1
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
@@ -11,7 +11,7 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
 license="NCSA"
 homepage="https://include-what-you-use.org/"
 distfiles="https://include-what-you-use.org/downloads/${pkgname}-${version}.src.tar.gz"
-checksum=8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c
+checksum=2b10157b60ea08adc08e3896b4921c73fcadd5ec4eb652b29a34129d501e5ee0
 python_version=3
 
 post_install() {

From 0d44ac41c2948d6fe21a9297bd27926d26efb798 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:11:04 +0100
Subject: [PATCH 11/26] rtags: rebuild for llvm15

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

diff --git a/srcpkgs/rtags/template b/srcpkgs/rtags/template
index b496a1b0e721..9b161e690d76 100644
--- a/srcpkgs/rtags/template
+++ b/srcpkgs/rtags/template
@@ -1,7 +1,7 @@
 # Template file for 'rtags'
 pkgname=rtags
 version=2.38
-revision=5
+revision=6
 build_style=cmake
 # Don't run tests in do_install, please.
 configure_args="-DSKIP_CTEST=TRUE"

From d27a705e799479b019adfac69adeb19bb82eebc7 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 6 Jan 2023 17:14:14 +0100
Subject: [PATCH 12/26] juCi++: rebuild for llvm15

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

diff --git a/srcpkgs/juCi++/template b/srcpkgs/juCi++/template
index c1969237f11d..416bde7cc4d0 100644
--- a/srcpkgs/juCi++/template
+++ b/srcpkgs/juCi++/template
@@ -1,7 +1,7 @@
 # Template file for 'juCi++'
 pkgname=juCi++
 version=1.7.2
-revision=2
+revision=3
 _libclangmm_commit="9704b9b6de0982a588fa41741157d5640afedf30"
 _tiny_commit="839ff806dc447ff49af80f9a9eaa7949f770f8e5"
 create_wrksrc=yes

From 018e9bb8fc59b4283909ee4feaf65401c0c8a188 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 7 Jan 2023 11:31:14 +0100
Subject: [PATCH 13/26] qt5: rebuild for llvm15

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

diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template
index f4f9f5b5344a..b517b49ead2d 100644
--- a/srcpkgs/qt5/template
+++ b/srcpkgs/qt5/template
@@ -5,7 +5,7 @@ pkgname=qt5
 version=5.15.7+20221119
 # commit f8c9fb304bc3e53b3aa07f962cd74e9160decccc
 # base repo: https://invent.kde.org/qt/qt/qt5
-revision=1
+revision=2
 build_style=meta
 hostmakedepends="cmake clang flex perl glib-devel pkg-config
  python re2c ruby which"

From 37c13368f46ed16d6c6b1ab12eb38a4f143e1c16 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:22:18 +0100
Subject: [PATCH 14/26] codelite: rebuild for llvm15

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

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 6b8b007c8a43..c6115e0274ce 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -1,7 +1,7 @@
 # Template file for 'codelite'
 pkgname=codelite
 version=16.0.0
-revision=2
+revision=3
 create_wrksrc=yes
 build_style=cmake
 build_helper=cmake-wxWidgets-gtk3

From 830dbffe37fa9627d81b132e66dce9d841b1c5f8 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 9 Jan 2023 01:58:21 +0100
Subject: [PATCH 15/26] kdevelop: rebuild for llvm15

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

diff --git a/srcpkgs/kdevelop/template b/srcpkgs/kdevelop/template
index 69c9bba1b881..87bb6b2d43f7 100644
--- a/srcpkgs/kdevelop/template
+++ b/srcpkgs/kdevelop/template
@@ -1,7 +1,7 @@
 # Template file for 'kdevelop'
 pkgname=kdevelop
 version=22.12.2
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DBUILD_TESTING=OFF"
 hostmakedepends="extra-cmake-modules qt5-qmake qt5-host-tools qt5-tools

From 9435dd344622f799b548252acd9703c8559b9406 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Mon, 16 Jan 2023 14:43:47 +0100
Subject: [PATCH 16/26] zig: update to 0.10.1

---
 .../0001-std.build-fix-handling-of-Dcpu.patch | 48 -------------------
 srcpkgs/zig/template                          | 10 ++--
 2 files changed, 6 insertions(+), 52 deletions(-)
 delete mode 100644 srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch

diff --git a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch b/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
deleted file mode 100644
index 4101f24459bb..000000000000
--- a/srcpkgs/zig/patches/0001-std.build-fix-handling-of-Dcpu.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 1e8cdace7ad324a42228aeb5cd6eb8dd15429413 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <ifreund@ifreund.xyz>
-Date: Tue, 21 Sep 2021 21:06:10 +0200
-Subject: [PATCH] std.build: fix handling of -Dcpu
-
-Currently -Dcpu is completely ignored if -Dtarget isn't passed as well.
-Further, -Dcpu=baseline is ignored even if -Dtarget=native is passed.
-
-This patch fixes these 2 issues, always respecting the -Dcpu option if
-present.
----
- lib/std/build.zig | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/lib/std/build.zig b/lib/std/build.zig
-index 9b7ebb1f4..e398529f9 100644
---- a/lib/std/build.zig
-+++ b/lib/std/build.zig
-@@ -685,7 +685,11 @@ pub const Builder = struct {
-         );
-         const mcpu = self.option([]const u8, "cpu", "Target CPU");
- 
--        const triple = maybe_triple orelse return args.default_target;
-+        if (maybe_triple == null and mcpu == null) {
-+            return args.default_target;
-+        }
-+
-+        const triple = maybe_triple orelse "native";
- 
-         var diags: CrossTarget.ParseOptions.Diagnostics = .{};
-         const selected_target = CrossTarget.parse(.{
-@@ -2451,11 +2455,8 @@ pub const LibExeObjStep = struct {
- 
-             if (populated_cpu_features.eql(cross.cpu.features)) {
-                 // The CPU name alone is sufficient.
--                // If it is the baseline CPU, no command line args are required.
--                if (cross.cpu.model != std.Target.Cpu.baseline(cross.cpu.arch).model) {
--                    try zig_args.append("-mcpu");
--                    try zig_args.append(cross.cpu.model.name);
--                }
-+                try zig_args.append("-mcpu");
-+                try zig_args.append(cross.cpu.model.name);
-             } else {
-                 var mcpu_buffer = std.ArrayList(u8).init(builder.allocator);
- 
--- 
-2.33.1
-
diff --git a/srcpkgs/zig/template b/srcpkgs/zig/template
index 728c5a64e9df..9807f7ab206b 100644
--- a/srcpkgs/zig/template
+++ b/srcpkgs/zig/template
@@ -1,17 +1,19 @@
 # Template file for 'zig'
 pkgname=zig
-version=0.8.1
-revision=2
+version=0.10.1
+revision=1
 archs="x86_64* aarch64*"
 build_style=cmake
 make_cmd=make
-makedepends="clang llvm12 lld-devel"
+# we add xml2, zstd, zlib and ncurses
+# because our lld is static-only and requires those to work
+makedepends="clang llvm15 lld-devel libxml2-devel libzstd-devel ncurses-devel zlib-devel"
 short_desc="Programming language designed for robustness, optimality, and clarity"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="MIT"
 homepage="https://ziglang.org"
 distfiles="https://ziglang.org/download/${version}/zig-${version}.tar.xz"
-checksum=8c428e14a0a89cb7a15a6768424a37442292858cdb695e2eb503fa3c7bf47f1a
+checksum=69459bc804333df077d441ef052ffa143d53012b655a51f04cfef1414c04168c
 nopie=yes
 nocross=yes
 

From 19bb1452151202d586c28183b35d1f52a08ce734 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Tue, 24 Jan 2023 14:03:51 +0100
Subject: [PATCH 17/26] river: update to 0.2.3

---
 ...ble-PIE-for-river-riverctl-rivertile.patch | 42 -------------------
 srcpkgs/river/template                        | 10 ++---
 2 files changed, 5 insertions(+), 47 deletions(-)
 delete mode 100644 srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch

diff --git a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch b/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
deleted file mode 100644
index ecc68302db09..000000000000
--- a/srcpkgs/river/patches/0001-Enable-PIE-for-river-riverctl-rivertile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 759c1c7a915083f3da46960ff82fa2a3566a7065 Mon Sep 17 00:00:00 2001
-From: Isaac Freund <mail@isaacfreund.com>
-Date: Wed, 3 Nov 2021 14:21:35 +0100
-Subject: [PATCH] Enable PIE for river, riverctl, rivertile
-
-There is sadly not yet a standard way to do this exposed by the zig
-build system. See: https://github.com/ziglang/zig/issues/7201
----
- build.zig | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/build.zig b/build.zig
-index d561f49..8ac9a4e 100644
---- a/build.zig
-+++ b/build.zig
-@@ -85,6 +85,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const river = b.addExecutable("river", "river/main.zig");
-         river.setTarget(target);
-         river.setBuildMode(mode);
-+        river.pie = true;
-         river.addBuildOption(bool, "xwayland", xwayland);
-         river.addBuildOption([:0]const u8, "version", full_version);
- 
-@@ -97,6 +98,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const riverctl = b.addExecutable("riverctl", "riverctl/main.zig");
-         riverctl.setTarget(target);
-         riverctl.setBuildMode(mode);
-+        riverctl.pie = true;
-         riverctl.addBuildOption([:0]const u8, "version", full_version);
- 
-         riverctl.step.dependOn(&scanner.step);
-@@ -114,6 +116,7 @@ pub fn build(b: *zbs.Builder) !void {
-         const rivertile = b.addExecutable("rivertile", "rivertile/main.zig");
-         rivertile.setTarget(target);
-         rivertile.setBuildMode(mode);
-+        rivertile.pie = true;
-         rivertile.addBuildOption([:0]const u8, "version", full_version);
- 
-         rivertile.step.dependOn(&scanner.step);
--- 
-2.33.1
-
diff --git a/srcpkgs/river/template b/srcpkgs/river/template
index 3906858d507e..431aa4bd8e8e 100644
--- a/srcpkgs/river/template
+++ b/srcpkgs/river/template
@@ -1,18 +1,18 @@
 # Template file for 'river'
 pkgname=river
-version=0.1.1
-revision=2
+version=0.2.3
+revision=1
 build_style=zig-build
-configure_args="$(vopt_if xwayland -Dxwayland)"
+configure_args="$(vopt_if xwayland -Dxwayland) -Dpie"
 hostmakedepends="pkg-config wayland-devel scdoc"
-makedepends="wlroots0.15-devel libevdev-devel"
+makedepends="wlroots-devel libevdev-devel"
 depends="$(vopt_if xwayland xorg-server-xwayland)"
 short_desc="Dynamic tiling Wayland compositor"
 maintainer="Isaac Freund <mail@isaacfreund.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/riverwm/river"
 distfiles="${homepage}/releases/download/v${version}/river-${version}.tar.gz"
-checksum=2a0bcd4670ed9ebd39c279f2bf10803fc65c9f3ee2307ce40728df23ce914d18
+checksum=7acdd2b929e16a20006b4baf1f29e7a8dc7f70cf5747e1503a610a90d1637132
 
 build_options="xwayland"
 build_options_default="xwayland"

From f7568d99bf7cb2e6f4501460d475bab41ec7ff96 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 17:25:32 +0100
Subject: [PATCH 18/26] libclc: update to 15.0.7

---
 srcpkgs/libclc/template | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libclc/template b/srcpkgs/libclc/template
index 779519fd666f..adb60f6ad1f1 100644
--- a/srcpkgs/libclc/template
+++ b/srcpkgs/libclc/template
@@ -1,9 +1,11 @@
 # Template file for 'libclc'
 pkgname=libclc
-version=12.0.0
+version=15.0.7
 revision=1
 build_style=cmake
-configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release"
+# disable clspv (failing tests, we don't ship it)
+configure_args="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
+ -DLIBCLC_TARGETS_TO_BUILD=amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl;spirv-mesa3d-;spirv64-mesa3d-"
 hostmakedepends="cmake clang llvm python3 libedit-devel libffi-devel
  ncurses-devel zlib-devel SPIRV-LLVM-Translator"
 short_desc="Open implementation of the OpenCL C programming language"
@@ -11,7 +13,7 @@ maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause, MIT"
 homepage="https://libclc.llvm.org"
 distfiles="https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/libclc-${version}.src.tar.xz"
-checksum=6b777ee2cd57da1b122f76c208463f620eef508f4128210c6b1a96bfb75c74dc
+checksum=35731fea7be224f21acf5bf3cd9f0ed058bf4ada5eceaf7f10ee96e139bd3389
 replaces="libclc-git>=0"
 
 do_configure() {

From a0e8daf7007bcab0fb2a88a7881698de0eb3d90e Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Fri, 10 Feb 2023 20:20:43 +0100
Subject: [PATCH 19/26] shiboken2: update to 5.15.7

---
 srcpkgs/shiboken2/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/shiboken2/template b/srcpkgs/shiboken2/template
index 9ceb8b313de7..084ecc3ba1e1 100644
--- a/srcpkgs/shiboken2/template
+++ b/srcpkgs/shiboken2/template
@@ -1,7 +1,7 @@
 # Template file for 'shiboken2'
 pkgname=shiboken2
-version=5.15.5
-revision=2
+version=5.15.7
+revision=1
 _pkgname="pyside-setup-opensource-src-${version}"
 build_wrksrc="sources/shiboken2"
 build_style=cmake
@@ -14,7 +14,7 @@ maintainer="yopito <pierre.bourgin@free.fr>"
 license="GPL-3.0-or-later"
 homepage="https://wiki.qt.io/Qt_for_Python/Shiboken"
 distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
-checksum=3920a4fb353300260c9bc46ff70f1fb975c5e7efa22e9d51222588928ce19b33
+checksum=f61210ae24e6882d5d0ca0059229e5dc4f35e2bca92dd6caf96c0f41943a8294
 
 python_version=3
 export CLANG_INSTALL_DIR=${XBPS_CROSS_BASE}/usr

From 4ea8dcf730cb1b6387442d7e0f3181e415172b70 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 20:13:02 +0100
Subject: [PATCH 20/26] clazy: rebuild for llvm15

---
 .../patches/0002-llvm15-compatibility.patch   | 220 ++++++++++++++++++
 srcpkgs/clazy/template                        |   2 +-
 2 files changed, 221 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/clazy/patches/0002-llvm15-compatibility.patch

diff --git a/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
new file mode 100644
index 000000000000..18213a66fca1
--- /dev/null
+++ b/srcpkgs/clazy/patches/0002-llvm15-compatibility.patch
@@ -0,0 +1,220 @@
+From 20fca52da739ebefa47e35f6b338bb99a0da3cfe Mon Sep 17 00:00:00 2001
+From: Cristian Adam <cristian.adam@qt.io>
+Date: Tue, 6 Sep 2022 16:30:02 +0200
+Subject: [PATCH] Build fixes for LLVM/Clang 15.0.0
+
+Change-Id: Icc39a0b1acffb5a6a4798b1259d8ad4e7dd47bc5
+---
+ CMakeLists.txt                              |  6 ++++++
+ src/PreProcessorVisitor.cpp                 |  2 +-
+ src/PreProcessorVisitor.h                   |  2 +-
+ src/SourceCompatibilityHelpers.h            | 15 +++++++++++++++
+ src/Utils.cpp                               |  3 ++-
+ src/checkbase.cpp                           |  4 ++--
+ src/checkbase.h                             |  4 ++--
+ src/checks/manuallevel/qt6-fwd-fixes.cpp    |  2 +-
+ src/checks/manuallevel/qt6-fwd-fixes.h      |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.cpp |  2 +-
+ src/checks/manuallevel/qt6-header-fixes.h   |  2 +-
+ 11 files changed, 33 insertions(+), 11 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3c780b0d..100135af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -114,6 +114,10 @@ else()
+     set(clang_tooling_refactoring_lib clangToolingRefactor)
+ endif()
+ 
++if (${LLVM_VERSION} VERSION_GREATER_EQUAL "15.0.0")
++  set(clang_support_lib clangSupport)
++endif()
++
+ macro(link_to_llvm name is_standalone)
+   if (CLAZY_LINK_CLANG_DYLIB)
+     target_link_libraries(${name} clang-cpp)
+@@ -131,6 +135,7 @@ macro(link_to_llvm name is_standalone)
+ 
+       target_link_libraries(${name} ${clang_lib})
+     endforeach()
++    target_link_libraries(${name} ${clang_support_lib})
+     target_link_libraries(${name} clangTooling)
+     target_link_libraries(${name} clangToolingCore)
+     target_link_libraries(${name} ${clang_tooling_refactoring_lib})
+@@ -302,6 +307,7 @@ else()
+     clangFrontendTool
+     clangRewrite
+     clangSerialization
++    ${clang_support_lib}
+     clangTooling
+     clangStaticAnalyzerCheckers
+     clangStaticAnalyzerCore
+diff --git a/src/PreProcessorVisitor.cpp b/src/PreProcessorVisitor.cpp
+index 5e63a131..5fdfe5f3 100644
+--- a/src/PreProcessorVisitor.cpp
++++ b/src/PreProcessorVisitor.cpp
+@@ -185,7 +185,7 @@ void PreProcessorVisitor::MacroExpands(const Token &MacroNameTok, const MacroDef
+ 
+ void PreProcessorVisitor::InclusionDirective (clang::SourceLocation, const clang::Token &,
+                                               clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                                              const clang::FileEntry *, clang::StringRef, clang::StringRef,
++                                              clazy::OptionalFileEntryRef, clang::StringRef, clang::StringRef,
+                                               const clang::Module *, clang::SrcMgr::CharacteristicKind)
+ {
+    if (m_ci.getPreprocessor().isInPrimaryFile() && !clazy::endsWith(FileName.str(), ".moc")) {
+diff --git a/src/PreProcessorVisitor.h b/src/PreProcessorVisitor.h
+index dc80ff36..1bb17a5e 100644
+--- a/src/PreProcessorVisitor.h
++++ b/src/PreProcessorVisitor.h
+@@ -71,7 +71,7 @@ class PreProcessorVisitor
+                       clang::SourceRange range, const clang::MacroArgs *) override;
+     void InclusionDirective (clang::SourceLocation HashLoc, const clang::Token &IncludeTok,
+                              clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange,
+-                             const clang::FileEntry *File, clang::StringRef SearchPath, clang::StringRef RelativePath,
++                             clazy::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath,
+                              const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     std::string getTokenSpelling(const clang::MacroDefinition &) const;
+diff --git a/src/SourceCompatibilityHelpers.h b/src/SourceCompatibilityHelpers.h
+index 4ea923a2..c1a23a4b 100644
+--- a/src/SourceCompatibilityHelpers.h
++++ b/src/SourceCompatibilityHelpers.h
+@@ -144,6 +144,21 @@ inline bool contains_lower(clang::StringRef haystack, clang::StringRef needle)
+ #endif
+ }
+ 
++#if LLVM_VERSION_MAJOR >= 15
++using OptionalFileEntryRef = clang::Optional<clang::FileEntryRef>;
++#else
++using OptionalFileEntryRef = const clang::FileEntry*;
++#endif
++
++inline bool isAscii(clang::StringLiteral *lt)
++{
++#if LLVM_VERSION_MAJOR >= 15
++    return lt->isOrdinary();
++#else
++    return lt->isAscii();
++#endif
++}
++
+ }
+ 
+ #endif
+diff --git a/src/Utils.cpp b/src/Utils.cpp
+index 3cdf7876..70e0577c 100644
+--- a/src/Utils.cpp
++++ b/src/Utils.cpp
+@@ -25,6 +25,7 @@
+ #include "Utils.h"
+ #include "StringUtils.h"
+ #include "HierarchyUtils.h"
++#include "SourceCompatibilityHelpers.h"
+ #include "StmtBodyRange.h"
+ #include "clazy_stl.h"
+ 
+@@ -670,7 +671,7 @@ const CXXRecordDecl *Utils::recordForMemberCall(CXXMemberCallExpr *call, string
+ bool Utils::isAscii(StringLiteral *lt)
+ {
+     // 'é' for some reason has isAscii() == true, so also call containsNonAsciiOrNull
+-    return lt && lt->isAscii() && !lt->containsNonAsciiOrNull();
++    return lt && clazy::isAscii(lt) && !lt->containsNonAsciiOrNull();
+ }
+ 
+ bool Utils::isInDerefExpression(Stmt *s, ParentMap *map)
+diff --git a/src/checkbase.cpp b/src/checkbase.cpp
+index f5936dfd..dcc7c999 100644
+--- a/src/checkbase.cpp
++++ b/src/checkbase.cpp
+@@ -105,7 +105,7 @@ void ClazyPreprocessorCallbacks::MacroDefined(const Token &macroNameTok, const M
+ }
+ 
+ void ClazyPreprocessorCallbacks::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                                                    clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                                                    clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                                                     clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     check->VisitInclusionDirective(HashLoc, IncludeTok, FileName, IsAngled, FilenameRange, File, SearchPath, RelativePath, Imported, FileType);
+@@ -182,7 +182,7 @@ void CheckBase::VisitEndif(SourceLocation, SourceLocation)
+ }
+ 
+ void CheckBase::VisitInclusionDirective(clang::SourceLocation , const clang::Token &, clang::StringRef , bool ,
+-                        clang::CharSourceRange , const clang::FileEntry *, clang::StringRef ,
++                        clang::CharSourceRange , clazy::OptionalFileEntryRef, clang::StringRef ,
+                         clang::StringRef , const clang::Module *, clang::SrcMgr::CharacteristicKind )
+ {
+     // Overriden in derived classes
+diff --git a/src/checkbase.h b/src/checkbase.h
+index c5db2daf..02f6a6bf 100644
+--- a/src/checkbase.h
++++ b/src/checkbase.h
+@@ -91,7 +91,7 @@ class ClazyPreprocessorCallbacks
+     void Else(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void Endif(clang::SourceLocation loc, clang::SourceLocation ifLoc) override;
+     void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ private:
+     CheckBase *const check;
+@@ -151,7 +151,7 @@ class CheckBase
+     virtual void VisitElse(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitEndif(clang::SourceLocation loc, clang::SourceLocation ifLoc);
+     virtual void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType);
+ 
+     void enablePreProcessorCallbacks();
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.cpp b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+index 83bf81ee..c87d9ca0 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.cpp
++++ b/src/checks/manuallevel/qt6-fwd-fixes.cpp
+@@ -166,7 +166,7 @@ void Qt6FwdFixes::VisitDecl(clang::Decl *decl)
+ }
+ 
+ void Qt6FwdFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     auto current_file = m_sm.getFilename(HashLoc);
+diff --git a/src/checks/manuallevel/qt6-fwd-fixes.h b/src/checks/manuallevel/qt6-fwd-fixes.h
+index 37b59d95..bb928ba6 100644
+--- a/src/checks/manuallevel/qt6-fwd-fixes.h
++++ b/src/checks/manuallevel/qt6-fwd-fixes.h
+@@ -47,7 +47,7 @@ class Qt6FwdFixes
+     explicit Qt6FwdFixes(const std::string &name, ClazyContext *context);
+     void VisitDecl(clang::Decl *decl) override;
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+     bool m_including_qcontainerfwd = false;
+     std::set<clang::StringRef> m_qcontainerfwd_included_in_files;
+diff --git a/src/checks/manuallevel/qt6-header-fixes.cpp b/src/checks/manuallevel/qt6-header-fixes.cpp
+index d458b77c..aaa28093 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.cpp
++++ b/src/checks/manuallevel/qt6-header-fixes.cpp
+@@ -270,7 +270,7 @@ Qt6HeaderFixes::Qt6HeaderFixes(const std::string &name, ClazyContext *context)
+ }
+ 
+ void Qt6HeaderFixes::VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                        clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                        clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                         clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType)
+ {
+     if (shouldIgnoreFile(HashLoc))
+diff --git a/src/checks/manuallevel/qt6-header-fixes.h b/src/checks/manuallevel/qt6-header-fixes.h
+index ae09f7ad..8ffbb100 100644
+--- a/src/checks/manuallevel/qt6-header-fixes.h
++++ b/src/checks/manuallevel/qt6-header-fixes.h
+@@ -46,7 +46,7 @@ class Qt6HeaderFixes
+ public:
+     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
+     void VisitInclusionDirective(clang::SourceLocation HashLoc, const clang::Token &IncludeTok, clang::StringRef FileName, bool IsAngled,
+-                            clang::CharSourceRange FilenameRange, const clang::FileEntry *File, clang::StringRef SearchPath,
++                            clang::CharSourceRange FilenameRange, clazy::OptionalFileEntryRef File, clang::StringRef SearchPath,
+                             clang::StringRef RelativePath, const clang::Module *Imported, clang::SrcMgr::CharacteristicKind FileType) override;
+ 
+ };
diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index 11f3bab55aef..f81de08ab836 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=1
+revision=2
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 4c95cff00c7401f5be77f6716ff9b9b3653bb68b Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:00 +0100
Subject: [PATCH 21/26] ldc: update to 1.31.0

---
 common/shlibs                                 |  8 +--
 ...4260a848c8ebad5582e27ac1e09627cdfb17.patch | 57 -------------------
 srcpkgs/ldc/template                          |  6 +-
 3 files changed, 7 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch

diff --git a/common/shlibs b/common/shlibs
index 88358c494779..ddd0a3266a36 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -2198,10 +2198,10 @@ libFcitx5Config.so.6 libfcitx5-5.0.5_1
 libFcitx5GClient.so.2 fcitx5-gtk-5.0.4_1
 libFcitx5Qt5DBusAddons.so.1 fcitx5-qt5-5.0.3_1
 libFcitx5Qt5WidgetsAddons.so.2 fcitx5-qt5-5.0.3_1
-libdruntime-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
-libdruntime-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-shared.so.100 ldc-runtime-1.30.0_1
-libphobos2-ldc-debug-shared.so.100 ldc-runtime-1.30.0_1
+libdruntime-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
+libdruntime-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-shared.so.101 ldc-runtime-1.31.0_1
+libphobos2-ldc-debug-shared.so.101 ldc-runtime-1.31.0_1
 libmarblewidget-qt5.so.28 marble5-17.12.2_1
 libastro.so.2 marble5-17.12.2_1
 libparrot.so.6.9.0 parrot-6.9.0_1
diff --git a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch b/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
deleted file mode 100644
index 79694372bfaa..000000000000
--- a/srcpkgs/ldc/patches/54544260a848c8ebad5582e27ac1e09627cdfb17.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 54544260a848c8ebad5582e27ac1e09627cdfb17 Mon Sep 17 00:00:00 2001
-From: Razvan Nitu <razvan.nitu1305@gmail.com>
-Date: Wed, 24 Aug 2022 13:54:15 +0300
-Subject: [PATCH] Port the fix for issue 23157 (#14378)
-
----
- druntime/src/core/sys/posix/sys/socket.d | 36 ++++++++++++++++++++++--
- 1 file changed, 33 insertions(+), 3 deletions(-)
-
-diff --git a/druntime/src/core/sys/posix/sys/socket.d b/druntime/src/core/sys/posix/sys/socket.d
-index 3a7b753adff..fc5dc5d1684 100644
---- a/runtime/druntime/src/core/sys/posix/sys/socket.d
-+++ b/runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -188,10 +188,40 @@ version (linux)
- 
-     extern (D) inout(ubyte)*   CMSG_DATA( return scope inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
- 
--    private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
--    extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+    version (CRuntime_Musl)
-     {
--        return __cmsg_nxthdr(msg, cmsg);
-+        extern (D)
-+        {
-+            private size_t __CMSG_LEN(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return (cmsg.cmsg_len + size_t.sizeof -1) & cast(size_t)(~(size_t.sizeof - 1));
-+            }
-+
-+            private inout(cmsghdr)* __CMSG_NEXT(inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg + __CMSG_LEN(cmsg);
-+            }
-+
-+            private inout(msghdr)* __MHDR_END(inout(msghdr)* mhdr) pure nothrow @nogc
-+            {
-+                return cast(inout(msghdr)*)(mhdr.msg_control + mhdr.msg_controllen);
-+            }
-+
-+            inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+            {
-+                return cmsg.cmsg_len < cmsghdr.sizeof ||
-+                    __CMSG_LEN(cmsg) + cmsghdr.sizeof >= __MHDR_END(msg) - cast(inout(msghdr)*)(cmsg)
-+                        ? cast(inout(cmsghdr)*) null : cast(inout(cmsghdr)*) __CMSG_NEXT(cmsg);
-+            }
-+        }
-+    }
-+    else
-+    {
-+        private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;
-+        extern (D)  inout(cmsghdr)* CMSG_NXTHDR(inout(msghdr)* msg, inout(cmsghdr)* cmsg) pure nothrow @nogc
-+        {
-+            return __cmsg_nxthdr(msg, cmsg);
-+        }
-     }
- 
-     extern (D) inout(cmsghdr)* CMSG_FIRSTHDR( inout(msghdr)* mhdr ) pure nothrow @nogc
diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index 99d22682ce7a..f6d8b7ffbe98 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,6 +1,6 @@
 # Template file for 'ldc'
 pkgname=ldc
-version=1.30.0
+version=1.31.0
 revision=1
 build_style=cmake
 configure_args="
@@ -11,7 +11,7 @@ configure_args="
  -DCOMPILE_D_MODULES_SEPARATELY=ON
  -DC_SYSTEM_LIBS='unwind;m;pthread;rt;dl'"
 conf_files="/etc/ldc2.conf"
-hostmakedepends="dmd llvm12 perl pkg-config"
+hostmakedepends="dmd llvm15 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"
@@ -22,7 +22,7 @@ license="BSD-3-Clause, BSL-1.0"
 homepage="https://wiki.dlang.org/LDC"
 changelog="https://raw.githubusercontent.com/ldc-developers/ldc/master/CHANGELOG.md"
 distfiles="https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"
-checksum=fdbb376f08242d917922a6a22a773980217fafa310046fc5d6459490af23dacd
+checksum=f1c8ece9e1e35806c3441bf24fbe666cddd8eef375592c19cd8fee4701cd5458
 nopie=yes
 nocross="dmd compilation fails on cross"
 # tests timeout on musl; also require unpackaged python3-lit

From 1178af7d7faa94f578022251bf33389aaff3e38f Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:42:46 +0100
Subject: [PATCH 22/26] gtkd: rebuild for ldc 1.31

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

diff --git a/srcpkgs/gtkd/template b/srcpkgs/gtkd/template
index e64a1f54fb96..6a75d69e19ce 100644
--- a/srcpkgs/gtkd/template
+++ b/srcpkgs/gtkd/template
@@ -1,7 +1,7 @@
 # Template file for 'gtkd'
 pkgname=gtkd
 version=3.9.0
-revision=9
+revision=10
 build_style=gnu-makefile
 make_build_args="LDFLAGS='-linker=bfd' DC=ldc2"
 make_build_target="shared-libs shared-gstreamer shared-vte shared-peas shared-gtkdgl"

From bd0c3a01ddf6598af30890971c5e4edbf8c51965 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Thu, 16 Feb 2023 23:43:29 +0100
Subject: [PATCH 23/26] onedrive: rebuild for ldc 1.31

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

diff --git a/srcpkgs/onedrive/template b/srcpkgs/onedrive/template
index 28163f334552..63e4f43a7fbd 100644
--- a/srcpkgs/onedrive/template
+++ b/srcpkgs/onedrive/template
@@ -1,7 +1,7 @@
 # Template file for 'onedrive'
 pkgname=onedrive
 version=2.4.13
-revision=4
+revision=5
 build_style=gnu-configure
 configure_args="DC=ldc2"
 hostmakedepends="ldc pkg-config"

From 7f3bb51d7ba7b19f669fbd90270cd1f3e97743bc Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Sat, 18 Feb 2023 20:33:19 +0100
Subject: [PATCH 24/26] qtcreator: rebuild for llvm15

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index 8eb1b7891f60..e8324b27077c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=1
+revision=2
 build_style=cmake
 configure_args="$(vopt_bool qbs BUILD_QBS) -DWITH_DOCS=ON -DBUILD_WITH_PCH=OFF"
 hostmakedepends="clang llvm perl pkg-config python3 which

From 49c2c1839ba282e571d5b8b47628a24d0d2d9f30 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 22 Feb 2023 13:33:41 +0100
Subject: [PATCH 25/26] tilix: rebuild for ldc 1.31

---
 srcpkgs/tilix/patches/undead.patch | 21 +++++++++++++++++++++
 srcpkgs/tilix/template             | 15 ++++++++++++---
 2 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/tilix/patches/undead.patch

diff --git a/srcpkgs/tilix/patches/undead.patch b/srcpkgs/tilix/patches/undead.patch
new file mode 100644
index 000000000000..3bc40d69f269
--- /dev/null
+++ b/srcpkgs/tilix/patches/undead.patch
@@ -0,0 +1,21 @@
+--- a/source/gx/tilix/prefeditor/prefdialog.d
++++ b/source/gx/tilix/prefeditor/prefdialog.d
+@@ -957,7 +957,7 @@ private:
+             return;
+         }
+ 
+-        import std.xml: DocumentParser, ElementParser, Element, XMLException;
++        import undead.xml: DocumentParser, ElementParser, Element, XMLException;
+ 
+         try {
+             DocumentParser parser = new DocumentParser(ui);
+--- a/meson.build
++++ b/meson.build
+@@ -91,6 +91,7 @@ tilix_sources = [
+     'source/secretc/secrettypes.d',
+     'source/x11/X.d',
+     'source/x11/Xlib.d',
++    'source/undead/xml.d',
+     'source/app.d'
+ ]
+ 
diff --git a/srcpkgs/tilix/template b/srcpkgs/tilix/template
index 5689948babaa..74ccb4dd4592 100644
--- a/srcpkgs/tilix/template
+++ b/srcpkgs/tilix/template
@@ -1,7 +1,9 @@
 # Template file for 'tilix'
 pkgname=tilix
 version=1.9.4
-revision=6
+revision=7
+_undead_version=1.1.8
+build_wrksrc="${pkgname}-${version}"
 build_style=meson
 configure_args="-Db_lto=false"
 hostmakedepends="automake gettext-devel gdk-pixbuf glib-devel ldc po4a pkg-config
@@ -13,8 +15,15 @@ short_desc="Tiling terminal emulator for Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="MPL-2.0"
 homepage="https://gnunn1.github.io/tilix-web/"
-distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz"
-checksum=2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+distfiles="https://github.com/gnunn1/${pkgname}/archive/${version}.tar.gz
+ https://github.com/dlang/undeaD/archive/refs/tags/v${_undead_version}.tar.gz"
+checksum="2a9482770391d11d5edc8351d426c700c2cc6c194a30391ef2ae25bb7095b59b
+ 36a59b4740b147f4345caa26908f40a97fc7cc67dac6983c226369c59f909e92"
+patch_args="-d ${build_wrksrc} -Np1"
+
+post_extract() {
+	mv undeaD-${_undead_version}/src/undead ${build_wrksrc}/source/
+}
 
 pre_configure() {
 	case "$XBPS_TARGET_MACHINE" in

From efb716ac444e768f9539fd3bc3a33bb5e25daef4 Mon Sep 17 00:00:00 2001
From: Marcin Puc <tranzystorek.io@protonmail.com>
Date: Wed, 1 Mar 2023 14:59:55 +0100
Subject: [PATCH 26/26] ispc: update to 1.19.0

---
 srcpkgs/ispc/patches/cmake-build-type-none.patch | 13 +++++++++++++
 srcpkgs/ispc/template                            | 12 ++++--------
 2 files changed, 17 insertions(+), 8 deletions(-)
 create mode 100644 srcpkgs/ispc/patches/cmake-build-type-none.patch

diff --git a/srcpkgs/ispc/patches/cmake-build-type-none.patch b/srcpkgs/ispc/patches/cmake-build-type-none.patch
new file mode 100644
index 000000000000..a962619d9335
--- /dev/null
+++ b/srcpkgs/ispc/patches/cmake-build-type-none.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c694166..405dc90 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -199,7 +199,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin )
+ 
+ if(CMAKE_BUILD_TYPE)
+     # Validate build type
+-    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
++    set(CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;None")
+ 
+     string(FIND "${CONFIGURATION_TYPES}" "${CMAKE_BUILD_TYPE}" MATCHED_CONFIG)
+     if (${MATCHED_CONFIG} EQUAL -1)
diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index 2b06217d0aab..574a75bab7e6 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,18 +1,18 @@
 # Template file for 'ispc'
 pkgname=ispc
-version=1.18.1
+version=1.19.0
 revision=1
 archs="x86_64*"
 build_style=cmake
-configure_args="-DISPC_NO_DUMPS=ON -DARM_ENABLED=OFF -DCMAKE_BUILD_TYPE=Release"
+configure_args="-DARM_ENABLED=OFF -DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"
 hostmakedepends="clang clang-tools-extra python3 m4 bison flex llvm"
-makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel libomp-devel"
+makedepends="ncurses-devel ncurses-libtinfo-devel zlib-devel"
 short_desc="Compiler for high-performance SIMD programming on the CPU"
 maintainer="Andrea Brancaleoni <abc@pompel.me>"
 license="BSD-3-Clause"
 homepage="https://ispc.github.io"
 distfiles="https://github.com/ispc/ispc/archive/v${version}.tar.gz"
-checksum=5b004c121e7a39c8654bb61930a240e4bd3e432a80d851c6281fae49f9aca7b7
+checksum=da1eccb8ead495b22d642340f3bab11fb64dd2223cd9cc92f0492f70b30f34b5
 nocross=yes
 nopie=yes
 
@@ -21,10 +21,6 @@ case "$XBPS_TARGET_MACHINE" in
 	x86_64) hostmakedepends+=" gcc-multilib";;
 esac
 
-pre_build() {
-	sed -i '/tinfo/d' CMakeLists.txt
-}
-
 post_install() {
 	vlicense LICENSE.txt
 }

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

* Re: [PR PATCH] [Closed]: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (90 preceding siblings ...)
  2023-03-30 22:02 ` tranzystorek-io
@ 2023-03-31 13:28 ` leahneukirchen
  2023-04-02 12:17 ` simvux
                   ` (2 subsequent siblings)
  94 siblings, 0 replies; 96+ messages in thread
From: leahneukirchen @ 2023-03-31 13:28 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

LLVM 15
https://github.com/void-linux/void-packages/pull/40821

Description:
[ci skip]

TODO:

- [x] ~~Adjust patches marked as `.patch.skip`~~ dropped support for ppc
- [x] Make libomp a shlib (change so file name and install a symlink)
- [x] Avoid creating triplet dirs under /usr/
- [x] Fix arm 32bit build https://github.com/void-linux/void-packages/pull/40821#issuecomment-1444617897

TODO LLVM rdeps:

- [x] clazy ~~(breaking changes in clang API)~~ - patched
- [x] beignet (https://github.com/void-linux/void-packages/pull/41529)
- [x] ispc (1.18.1 supports LLVM `<= 14`)
- [x] ldc (1.30.0 supports LLVM `<= 14`) - builds in version 1.31
  - [x] tilix fails to build with ldc 1.31 (https://github.com/gnunn1/tilix/issues/2151) - patched to use undeaD
- [x] ghdl (2.0.0 supports LLVM `<= 14`) - builds with llvm12
- [x] qt
- [x] qtcreator (#42290)
- [x] shiboken2 (tests failing with llvm15)
- [x] bpftrace (https://github.com/void-linux/void-packages/pull/39002)
- [x] libclc (tests fail with unresolved calls https://gist.githubusercontent.com/tranzystorek-io/a2aa8a0d8010af5299f7d1ff9f82c22b/raw/6d316d99d6079990b73ae77d274dd120b9560589/LastTest.log) -> removed clspv
- [x] zig

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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (91 preceding siblings ...)
  2023-03-31 13:28 ` [PR PATCH] [Closed]: " leahneukirchen
@ 2023-04-02 12:17 ` simvux
  2023-04-02 12:18 ` tranzystorek-io
  2023-04-02 12:19 ` simvux
  94 siblings, 0 replies; 96+ messages in thread
From: simvux @ 2023-04-02 12:17 UTC (permalink / raw)
  To: ml

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

New comment by simvux on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1493316705

Comment:
@tranzystorek-io @leahneukirchen the build of LLVM15 & Friends failed and the active LLVM version in the xbps repository is still 12 even though it's been 15 in the github repository for days. Is this a known problem right now? 

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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (92 preceding siblings ...)
  2023-04-02 12:17 ` simvux
@ 2023-04-02 12:18 ` tranzystorek-io
  2023-04-02 12:19 ` simvux
  94 siblings, 0 replies; 96+ messages in thread
From: tranzystorek-io @ 2023-04-02 12:18 UTC (permalink / raw)
  To: ml

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

New comment by tranzystorek-io on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1493317067

Comment:
@simvux this is a problem with repo-default, it hasn't been syncing up properly for sometime, to work around switch to repo-de

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

* Re: LLVM 15
  2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
                   ` (93 preceding siblings ...)
  2023-04-02 12:18 ` tranzystorek-io
@ 2023-04-02 12:19 ` simvux
  94 siblings, 0 replies; 96+ messages in thread
From: simvux @ 2023-04-02 12:19 UTC (permalink / raw)
  To: ml

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

New comment by simvux on void-packages repository

https://github.com/void-linux/void-packages/pull/40821#issuecomment-1493317185

Comment:
ah i see, thanks! 

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

end of thread, other threads:[~2023-04-02 12:19 UTC | newest]

Thread overview: 96+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28 15:30 [PR PATCH] [WIP] LLVM 15 tranzystorek-io
2022-11-28 15:32 ` tranzystorek-io
2022-11-28 16:36 ` dkwo
2022-11-28 19:13 ` [PR PATCH] [Updated] " tranzystorek-io
2022-11-28 23:49 ` tranzystorek-io
2022-11-29  0:31 ` tranzystorek-io
2022-12-05  8:05 ` tranzystorek-io
2022-12-05  8:17 ` tranzystorek-io
2022-12-05  8:22 ` [PR REVIEW] " oreo639
2022-12-05  8:22 ` oreo639
2022-12-05  8:29 ` oreo639
2022-12-05  8:29 ` oreo639
2022-12-05  8:30 ` oreo639
2022-12-05  8:39 ` oreo639
2022-12-05  9:28 ` oreo639
2022-12-05  9:55 ` oreo639
2022-12-05  9:55 ` oreo639
2022-12-06 10:11 ` [PR PATCH] [Updated] " tranzystorek-io
2022-12-07  5:04 ` Vaelatern
2022-12-07  5:04 ` Vaelatern
2022-12-12 18:26 ` [PR PATCH] [Updated] " tranzystorek-io
2022-12-17  8:56 ` tranzystorek-io
2022-12-17  9:00 ` tranzystorek-io
2022-12-17  9:09 ` tranzystorek-io
2022-12-17 10:44 ` [PR REVIEW] " paper42
2022-12-17 23:41 ` [PR PATCH] [Updated] " tranzystorek-io
2022-12-18  0:02 ` [PR REVIEW] " oreo639
2022-12-18  0:03 ` oreo639
2022-12-18  0:05 ` oreo639
2022-12-18 11:24 ` [PR PATCH] [Updated] " tranzystorek-io
2022-12-18 23:30 ` tranzystorek-io
2022-12-19 23:58 ` oreo639
2022-12-19 23:59 ` oreo639
2022-12-20  0:04 ` oreo639
2022-12-20  0:09 ` oreo639
2022-12-22  4:26 ` simvux
2022-12-22  4:48 ` oreo639
2022-12-22 10:15 ` ardadem
2023-01-05 14:13 ` [PR PATCH] [Updated] " tranzystorek-io
2023-01-06 12:39 ` [PR REVIEW] " tranzystorek-io
2023-01-06 12:56 ` [PR PATCH] [Updated] " tranzystorek-io
2023-01-06 16:15 ` tranzystorek-io
2023-01-07 10:31 ` tranzystorek-io
2023-01-07 17:02 ` tranzystorek-io
2023-01-09  0:22 ` tranzystorek-io
2023-01-09  0:58 ` tranzystorek-io
2023-01-10  8:20 ` dkwo
2023-01-12 18:46 ` [PR PATCH] [Updated] " tranzystorek-io
2023-01-14 22:16 ` Johnnynator
2023-01-15  1:46 ` [PR PATCH] [Updated] " tranzystorek-io
2023-01-16 13:45 ` tranzystorek-io
2023-01-17 19:01 ` [PR REVIEW] " Johnnynator
2023-01-24 13:05 ` [PR PATCH] [Updated] " tranzystorek-io
2023-01-24 13:15 ` tranzystorek-io
2023-01-26 22:36 ` tranzystorek-io
2023-02-01 12:34 ` tranzystorek-io
2023-02-05 12:42 ` tranzystorek-io
2023-02-05 13:58 ` tranzystorek-io
2023-02-07  9:14 ` tranzystorek-io
2023-02-10 14:20 ` tranzystorek-io
2023-02-10 14:49 ` oreo639
2023-02-10 14:50 ` oreo639
2023-02-10 14:51 ` oreo639
2023-02-10 14:51 ` oreo639
2023-02-10 14:55 ` oreo639
2023-02-10 16:26 ` [PR PATCH] [Updated] " tranzystorek-io
2023-02-10 16:42 ` tranzystorek-io
2023-02-10 19:21 ` tranzystorek-io
2023-02-15 17:27 ` tranzystorek-io
2023-02-16 19:17 ` tranzystorek-io
2023-02-16 22:44 ` tranzystorek-io
2023-02-18 19:34 ` tranzystorek-io
2023-02-19 22:34 ` simvux
2023-02-20  9:59 ` cmueller-tp
2023-02-22 12:35 ` [PR PATCH] [Updated] " tranzystorek-io
2023-02-22 14:35 ` tranzystorek-io
2023-02-22 19:26 ` tranzystorek-io
2023-02-22 19:41 ` [PR PATCH] [Updated] " tranzystorek-io
2023-02-24 22:55 ` Johnnynator
2023-03-01 14:02 ` [PR PATCH] [Updated] " tranzystorek-io
2023-03-10 14:35 ` tranzystorek-io
2023-03-13 14:25 ` motorto
2023-03-13 14:27 ` tranzystorek-io
2023-03-18  3:31 ` ihameed
2023-03-18  3:39 ` ihameed
2023-03-18  4:46 ` ihameed
2023-03-18  9:35 ` [PR PATCH] [Updated] " tranzystorek-io
2023-03-18 16:35 ` tranzystorek-io
2023-03-25  6:04 ` oreo639
2023-03-25 13:04 ` [PR PATCH] [Updated] " tranzystorek-io
2023-03-25 13:10 ` tranzystorek-io
2023-03-30 22:02 ` tranzystorek-io
2023-03-31 13:28 ` [PR PATCH] [Closed]: " leahneukirchen
2023-04-02 12:17 ` simvux
2023-04-02 12:18 ` tranzystorek-io
2023-04-02 12:19 ` simvux

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).