Github messages for voidlinux
 help / color / mirror / Atom feed
From: Duncaen <Duncaen@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: llvm16-16.0.3
Date: Thu, 04 May 2023 21:44:40 +0200	[thread overview]
Message-ID: <20230504194440.gsTcrn4OzuHxOgaHgI2mepMxcnK7X0ug2Lf2yRBzsvA@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-43739@inbox.vuxu.org>

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

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

https://github.com/Duncaen/void-packages llvm16
https://github.com/void-linux/void-packages/pull/43739

New package: llvm16-16.0.3
[ci skip]

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

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

From 8c04f9e9b505c146bda9b8d128d0d34d084fd191 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 01:50:17 +0200
Subject: [PATCH 01/21] New package: llvm16-16.0.3

---
 common/shlibs                                 |  11 +-
 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/libllvm16                             |   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 +-
 .../llvm16/files/llvm-Config-llvm-config.h    |   9 +
 ...s-set-a-larger-stack-size-explicitly.patch |  33 ++
 ..._EXEC-related-test-failures-on-aarch.patch |  26 +
 .../0016-libc-musl-locale-workarounds.patch   |  40 ++
 ...clang-001-fix-unwind-chain-inclusion.patch |  44 ++
 .../patches/clang-002-add-musl-triples.patch  | 115 +++++
 .../patches/cmake-runtimes-cmake-flags.patch  |  45 ++
 ...compiler-rt-sanitizer-supported-arch.patch |  22 +
 srcpkgs/llvm16/patches/libcxx-armv67.patch    |  22 +
 .../llvm16/patches/libcxx-ssp-nonshared.patch |  11 +
 srcpkgs/llvm16/patches/libcxxabi-dl.patch     |  25 +
 srcpkgs/llvm16/patches/libcxxabi-musl.patch   |  37 ++
 srcpkgs/llvm16/patches/libomp-soname.patch    |  12 +
 srcpkgs/llvm16/patches/llvm-001-musl.patch    |  44 ++
 .../patches/llvm-004-override-opt.patch       |  18 +
 .../llvm16/patches/llvm-005-ppc-bigpic.patch  |  36 ++
 .../llvm16/patches/revert-optimisation.patch  |  85 ++++
 srcpkgs/llvm16/template                       | 455 ++++++++++++++++++
 srcpkgs/llvm16/update                         |   3 +
 38 files changed, 1106 insertions(+), 22 deletions(-)
 create mode 120000 srcpkgs/libllvm16
 create mode 100644 srcpkgs/llvm16/files/llvm-Config-llvm-config.h
 create mode 100644 srcpkgs/llvm16/patches/0001-llvm-always-set-a-larger-stack-size-explicitly.patch
 create mode 100644 srcpkgs/llvm16/patches/0004-llvm-fix-some-MF_EXEC-related-test-failures-on-aarch.patch
 create mode 100644 srcpkgs/llvm16/patches/0016-libc-musl-locale-workarounds.patch
 create mode 100644 srcpkgs/llvm16/patches/clang-001-fix-unwind-chain-inclusion.patch
 create mode 100644 srcpkgs/llvm16/patches/clang-002-add-musl-triples.patch
 create mode 100644 srcpkgs/llvm16/patches/cmake-runtimes-cmake-flags.patch
 create mode 100644 srcpkgs/llvm16/patches/compiler-rt-sanitizer-supported-arch.patch
 create mode 100644 srcpkgs/llvm16/patches/libcxx-armv67.patch
 create mode 100644 srcpkgs/llvm16/patches/libcxx-ssp-nonshared.patch
 create mode 100644 srcpkgs/llvm16/patches/libcxxabi-dl.patch
 create mode 100644 srcpkgs/llvm16/patches/libcxxabi-musl.patch
 create mode 100644 srcpkgs/llvm16/patches/libomp-soname.patch
 create mode 100644 srcpkgs/llvm16/patches/llvm-001-musl.patch
 create mode 100644 srcpkgs/llvm16/patches/llvm-004-override-opt.patch
 create mode 100644 srcpkgs/llvm16/patches/llvm-005-ppc-bigpic.patch
 create mode 100644 srcpkgs/llvm16/patches/revert-optimisation.patch
 create mode 100644 srcpkgs/llvm16/template
 create mode 100644 srcpkgs/llvm16/update

diff --git a/common/shlibs b/common/shlibs
index 8c47e79b8c43..85617f9a4884 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,15 +990,16 @@ 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.15 lldb-15.0.7_1
-libclang.so.15 libclang-15.0.7_1
-libclang-cpp.so.15 libclang-cpp-15.0.7_1
+liblldb.so.16 lldb-16.0.7_1
+libclang.so.16 libclang-16.0.3_1
+libclang-cpp.so.16 libclang-cpp-16.0.3_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.15 SPIRV-LLVM-Translator-15.0.0_1
+libLLVM-16.so libllvm16-16.0.3_1
+libLLVMSPIRVLib.so.16 SPIRV-LLVM-Translator-16.0.3_1
 libomp.so.5 libomp-15.0.7_1
-libomptarget.so.15 libomp-15.0.7_1
+libomptarget.so.16 libomp-16.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/clang b/srcpkgs/clang
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/clang
+++ b/srcpkgs/clang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/clang-analyzer b/srcpkgs/clang-analyzer
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/clang-analyzer
+++ b/srcpkgs/clang-analyzer
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/clang-tools-extra b/srcpkgs/clang-tools-extra
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/clang-tools-extra
+++ b/srcpkgs/clang-tools-extra
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libclang b/srcpkgs/libclang
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/libclang
+++ b/srcpkgs/libclang
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libclang-cpp b/srcpkgs/libclang-cpp
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/libclang-cpp
+++ b/srcpkgs/libclang-cpp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libcxx b/srcpkgs/libcxx
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/libcxx
+++ b/srcpkgs/libcxx
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libcxx-devel b/srcpkgs/libcxx-devel
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/libcxx-devel
+++ b/srcpkgs/libcxx-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi b/srcpkgs/libcxxabi
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/libcxxabi
+++ b/srcpkgs/libcxxabi
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libcxxabi-devel b/srcpkgs/libcxxabi-devel
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/libcxxabi-devel
+++ b/srcpkgs/libcxxabi-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libllvm16 b/srcpkgs/libllvm16
new file mode 120000
index 000000000000..9910d5b12f6f
--- /dev/null
+++ b/srcpkgs/libllvm16
@@ -0,0 +1 @@
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libomp b/srcpkgs/libomp
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/libomp
+++ b/srcpkgs/libomp
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/libomp-devel b/srcpkgs/libomp-devel
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/libomp-devel
+++ b/srcpkgs/libomp-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/lld b/srcpkgs/lld
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/lld
+++ b/srcpkgs/lld
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/lld-devel b/srcpkgs/lld-devel
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/lld-devel
+++ b/srcpkgs/lld-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/lldb b/srcpkgs/lldb
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/lldb
+++ b/srcpkgs/lldb
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/lldb-devel b/srcpkgs/lldb-devel
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/lldb-devel
+++ b/srcpkgs/lldb-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind b/srcpkgs/llvm-libunwind
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/llvm-libunwind
+++ b/srcpkgs/llvm-libunwind
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/llvm-libunwind-devel b/srcpkgs/llvm-libunwind-devel
index ad57a969b9f9..9910d5b12f6f 120000
--- a/srcpkgs/llvm-libunwind-devel
+++ b/srcpkgs/llvm-libunwind-devel
@@ -1 +1 @@
-llvm15
\ No newline at end of file
+llvm16
\ No newline at end of file
diff --git a/srcpkgs/llvm16/files/llvm-Config-llvm-config.h b/srcpkgs/llvm16/files/llvm-Config-llvm-config.h
new file mode 100644
index 000000000000..2fa08c9be696
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/0001-llvm-always-set-a-larger-stack-size-explicitly.patch b/srcpkgs/llvm16/patches/0001-llvm-always-set-a-larger-stack-size-explicitly.patch
new file mode 100644
index 000000000000..e2cb672a2903
--- /dev/null
+++ b/srcpkgs/llvm16/patches/0001-llvm-always-set-a-larger-stack-size-explicitly.patch
@@ -0,0 +1,33 @@
+From 2f64910d7f5c0ee3bbdf7977099690fc58719fc1 Mon Sep 17 00:00:00 2001
+From: Daniel Kolesa <daniel@octaforge.org>
+Date: Tue, 2 May 2023 15:57:16 +0200
+Subject: [PATCH 01/27] llvm: always set a larger stack size explicitly
+
+---
+ llvm/lib/Support/Threading.cpp | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp
+index 923935bbc..b91b8f4bb 100644
+--- a/llvm/lib/Support/Threading.cpp
++++ b/llvm/lib/Support/Threading.cpp
+@@ -77,16 +77,7 @@ unsigned llvm::ThreadPoolStrategy::compute_thread_count() const {
+ // keyword.
+ #include "llvm/Support/thread.h"
+ 
+-#if defined(__APPLE__)
+-  // Darwin's default stack size for threads except the main one is only 512KB,
+-  // which is not enough for some/many normal LLVM compilations. This implements
+-  // the same interface as std::thread but requests the same stack size as the
+-  // main thread (8MB) before creation.
+ const std::optional<unsigned> llvm::thread::DefaultStackSize = 8 * 1024 * 1024;
+-#else
+-const std::optional<unsigned> llvm::thread::DefaultStackSize;
+-#endif
+-
+ 
+ #endif
+ 
+-- 
+2.39.0
+
diff --git a/srcpkgs/llvm16/patches/0004-llvm-fix-some-MF_EXEC-related-test-failures-on-aarch.patch b/srcpkgs/llvm16/patches/0004-llvm-fix-some-MF_EXEC-related-test-failures-on-aarch.patch
new file mode 100644
index 000000000000..66757a319534
--- /dev/null
+++ b/srcpkgs/llvm16/patches/0004-llvm-fix-some-MF_EXEC-related-test-failures-on-aarch.patch
@@ -0,0 +1,26 @@
+From fc7ba47ece14209c58ad9e5ddb145203039d9da5 Mon Sep 17 00:00:00 2001
+From: Daniel Kolesa <daniel@octaforge.org>
+Date: Tue, 2 May 2023 16:04:20 +0200
+Subject: [PATCH 04/27] llvm: fix some MF_EXEC related test failures on aarch64
+
+https://bugs.llvm.org/show_bug.cgi?id=14278#c10
+---
+ llvm/lib/Support/Unix/Memory.inc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/llvm/lib/Support/Unix/Memory.inc b/llvm/lib/Support/Unix/Memory.inc
+index 4c8f6b2ea..6cddae13b 100644
+--- a/llvm/lib/Support/Unix/Memory.inc
++++ b/llvm/lib/Support/Unix/Memory.inc
+@@ -50,7 +50,7 @@ static int getPosixProtectionFlags(unsigned Flags) {
+       llvm::sys::Memory::MF_EXEC:
+     return PROT_READ | PROT_WRITE | PROT_EXEC;
+   case llvm::sys::Memory::MF_EXEC:
+-#if defined(__FreeBSD__) || defined(__powerpc__)
++#if defined(__FreeBSD__) || defined(__powerpc__) || (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
+-- 
+2.39.0
+
diff --git a/srcpkgs/llvm16/patches/0016-libc-musl-locale-workarounds.patch b/srcpkgs/llvm16/patches/0016-libc-musl-locale-workarounds.patch
new file mode 100644
index 000000000000..8ff08c613ea0
--- /dev/null
+++ b/srcpkgs/llvm16/patches/0016-libc-musl-locale-workarounds.patch
@@ -0,0 +1,40 @@
+From 8105e17c547c80fc9940a46a0f2ae385d48b9ebb Mon Sep 17 00:00:00 2001
+From: Daniel Kolesa <daniel@octaforge.org>
+Date: Tue, 2 May 2023 16:17:41 +0200
+Subject: [PATCH 16/27] libc++: musl locale workarounds
+
+---
+ libcxx/include/locale | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libcxx/include/locale b/libcxx/include/locale
+index 874866f69..befed29bf 100644
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -758,7 +758,11 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
+         __libcpp_remove_reference_t<decltype(errno)> __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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+@@ -798,7 +802,11 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
+         __libcpp_remove_reference_t<decltype(errno)> __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
+         __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+         if (__current_errno == 0)
+             errno = __save_errno;
+-- 
+2.39.0
+
diff --git a/srcpkgs/llvm16/patches/clang-001-fix-unwind-chain-inclusion.patch b/srcpkgs/llvm16/patches/clang-001-fix-unwind-chain-inclusion.patch
new file mode 100644
index 000000000000..e4eaa7783e7a
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/clang-002-add-musl-triples.patch b/srcpkgs/llvm16/patches/clang-002-add-musl-triples.patch
new file mode 100644
index 000000000000..0ef4c7e75d6b
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/cmake-runtimes-cmake-flags.patch b/srcpkgs/llvm16/patches/cmake-runtimes-cmake-flags.patch
new file mode 100644
index 000000000000..dae632808fda
--- /dev/null
+++ b/srcpkgs/llvm16/patches/cmake-runtimes-cmake-flags.patch
@@ -0,0 +1,45 @@
+--- a/llvm/runtimes/CMakeLists.txt
++++ b/llvm/runtimes/CMakeLists.txt
+@@ -75,7 +75,8 @@
+                            CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR}
+                                       -DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR}
+                                       -DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_TARGET_TRIPLE}
+-                                      -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default}
++                                      -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF
++                                      -DLLVM_ENABLE_SPHINX=ON
+                                       -DCMAKE_C_COMPILER_WORKS=ON
+                                       -DCMAKE_ASM_COMPILER_WORKS=ON
+                                       ${COMMON_CMAKE_ARGS}
+@@ -109,7 +110,9 @@
+                            CMAKE_ARGS -DLLVM_LIBRARY_OUTPUT_INTDIR=${LLVM_LIBRARY_DIR}
+                                       -DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_TOOLS_BINARY_DIR}
+                                       -DLLVM_DEFAULT_TARGET_TRIPLE=${target}
+-                                      -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON
++                                      -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF
++                                      -DLLVM_ENABLE_SPHINX=ON
++                                      -DLLVM_INCLUDE_DOCS=ON
+                                       -DCMAKE_C_COMPILER_WORKS=ON
+                                       -DCMAKE_ASM_COMPILER_WORKS=ON
+                                       -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
+@@ -231,7 +234,9 @@
+                                       -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
+                                       -DLLVM_DEFAULT_TARGET_TRIPLE=${LLVM_TARGET_TRIPLE}
+                                       -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED}
+-                                      -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default}
++                                      -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF
++                                      -DLLVM_ENABLE_SPHINX=ON
++                                      -DLLVM_INCLUDE_DOCS=ON
+                                       -DLLVM_BUILD_TOOLS=${LLVM_BUILD_TOOLS}
+                                       -DCMAKE_C_COMPILER_WORKS=ON
+                                       -DCMAKE_CXX_COMPILER_WORKS=ON
+@@ -356,7 +361,9 @@
+                                       -DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
+                                       -DLLVM_DEFAULT_TARGET_TRIPLE=${target}
+                                       -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED}
+-                                      -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON
++                                      -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF
++                                      -DLLVM_ENABLE_SPHINX=ON
++                                      -DLLVM_INCLUDE_DOCS=ON
+                                       -DCMAKE_C_COMPILER_WORKS=ON
+                                       -DCMAKE_CXX_COMPILER_WORKS=ON
+                                       -DCMAKE_ASM_COMPILER_WORKS=ON
diff --git a/srcpkgs/llvm16/patches/compiler-rt-sanitizer-supported-arch.patch b/srcpkgs/llvm16/patches/compiler-rt-sanitizer-supported-arch.patch
new file mode 100644
index 000000000000..c9b9286ac37b
--- /dev/null
+++ b/srcpkgs/llvm16/patches/compiler-rt-sanitizer-supported-arch.patch
@@ -0,0 +1,22 @@
+Based on patch from Alpine:
+https://gitlab.alpinelinux.org/alpine/aports/-/blob/693203c42aa1cde88cb547173ef67a98824973fd/main/llvm-runtimes/compiler-rt-sanitizer-supported-arch.patch
+
+Sanitizer code is broken on armhf, armv7, s390x, x86, and probably riscv64 on musl,
+i.e. enable it only on x86_64, aarch64, and ppc64le.
+
+--- a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
++++ b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+@@ -23,9 +23,13 @@ if(APPLE)
+   set(X86_64 x86_64 x86_64h)
+ endif()
+ 
++if (LIBCXX_HAS_MUSL_LIBC)
++set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86_64} ${ARM64} ${PPC64})
++else()
+ set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} ${RISCV64}
+     ${ARM32} ${ARM64} ${MIPS32} ${MIPS64} ${S390X} ${SPARC} ${SPARCV9}
+     ${HEXAGON} ${LOONGARCH64})
++endif()
+ set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
+     ${MIPS32} ${MIPS64} ${PPC64} ${S390X} ${SPARC} ${SPARCV9} ${HEXAGON}
+     ${LOONGARCH64})
diff --git a/srcpkgs/llvm16/patches/libcxx-armv67.patch b/srcpkgs/llvm16/patches/libcxx-armv67.patch
new file mode 100644
index 000000000000..1dab312c83e3
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/libcxx-ssp-nonshared.patch b/srcpkgs/llvm16/patches/libcxx-ssp-nonshared.patch
new file mode 100644
index 000000000000..70292beb2fcd
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/libcxxabi-dl.patch b/srcpkgs/llvm16/patches/libcxxabi-dl.patch
new file mode 100644
index 000000000000..3a15f9db8c98
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/libcxxabi-musl.patch b/srcpkgs/llvm16/patches/libcxxabi-musl.patch
new file mode 100644
index 000000000000..5072fe85c4d4
--- /dev/null
+++ b/srcpkgs/llvm16/patches/libcxxabi-musl.patch
@@ -0,0 +1,37 @@
+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,24 +24,24 @@
+ extern "C" {
+ #endif
+ 
+-inline _LIBCPP_HIDE_FROM_ABI_C long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) {
++static inline _LIBCPP_HIDE_FROM_ABI_C long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) {
+   return ::strtoll(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long
++static inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long
+ strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) {
+   return ::strtoull(__nptr, __endptr, __base);
+ }
+ 
+-inline _LIBCPP_HIDE_FROM_ABI_C long long wcstoll_l(const wchar_t* __nptr, wchar_t** __endptr, int __base, locale_t) {
++static inline _LIBCPP_HIDE_FROM_ABI_C 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_C long long wcstoull_l(const wchar_t* __nptr, wchar_t** __endptr, int __base, locale_t) {
++static inline _LIBCPP_HIDE_FROM_ABI_C 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_C long double wcstold_l(const wchar_t* __nptr, wchar_t** __endptr, locale_t) {
++static inline _LIBCPP_HIDE_FROM_ABI_C long double wcstold_l(const wchar_t* __nptr, wchar_t** __endptr, locale_t) {
+   return ::wcstold(__nptr, __endptr);
+ }
+ 
diff --git a/srcpkgs/llvm16/patches/libomp-soname.patch b/srcpkgs/llvm16/patches/libomp-soname.patch
new file mode 100644
index 000000000000..9a622cd9254c
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/llvm-001-musl.patch b/srcpkgs/llvm16/patches/llvm-001-musl.patch
new file mode 100644
index 000000000000..b6efd02a5698
--- /dev/null
+++ b/srcpkgs/llvm16/patches/llvm-001-musl.patch
@@ -0,0 +1,44 @@
+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/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
+index d882ab2e..f1fb12d0 100644
+--- a/third-party/unittest/googletest/src/gtest.cc
++++ b/third-party/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/llvm16/patches/llvm-004-override-opt.patch b/srcpkgs/llvm16/patches/llvm-004-override-opt.patch
new file mode 100644
index 000000000000..51d0e4b31b32
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/llvm-005-ppc-bigpic.patch b/srcpkgs/llvm16/patches/llvm-005-ppc-bigpic.patch
new file mode 100644
index 000000000000..d332687b9d92
--- /dev/null
+++ b/srcpkgs/llvm16/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/llvm16/patches/revert-optimisation.patch b/srcpkgs/llvm16/patches/revert-optimisation.patch
new file mode 100644
index 000000000000..7db7eed22291
--- /dev/null
+++ b/srcpkgs/llvm16/patches/revert-optimisation.patch
@@ -0,0 +1,85 @@
+Patch-Source: https://gist.github.com/q66/1d48bbbec3a9319af587628a67b5e477
+--
+From 0731e96271e4c899f4f9c06d67cb605ee50d4e9b Mon Sep 17 00:00:00 2001
+From: Daniel Kolesa <daniel@octaforge.org>
+Date: Wed, 3 May 2023 01:36:56 +0200
+Subject: [PATCH] llvm: HACK: pessimize alias analysis to fix firefox
+
+This is probably not good, but it's what allows us to get
+firefox fixed for the time being, so...
+
+Ref: https://github.com/llvm/llvm-project/issues/58776
+---
+ llvm/lib/Analysis/BasicAliasAnalysis.cpp      |  2 ++
+ .../lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp | 36 +++++++++++++++++++
+ 2 files changed, 38 insertions(+)
+
+diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+index dc728c1cb..e0f5789c6 100644
+--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
++++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+@@ -698,6 +698,7 @@ ModRefInfo BasicAAResult::getModRefInfoMask(const MemoryLocation &Loc,
+     if (IgnoreLocals && isa<AllocaInst>(V))
+       continue;
+ 
++#if 0
+     // If the location points to memory that is known to be invariant for
+     // the life of the underlying SSA value, then we can exclude Mod from
+     // the set of valid memory effects.
+@@ -710,6 +711,7 @@ ModRefInfo BasicAAResult::getModRefInfoMask(const MemoryLocation &Loc,
+         continue;
+       }
+     }
++#endif
+ 
+     // A global constant can't be mutated.
+     if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V)) {
+diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
+index 8155c895e..6e3558e16 100644
+--- a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
++++ b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
+@@ -138,5 +138,41 @@ ModRefInfo AMDGPUAAResult::getModRefInfoMask(const MemoryLocation &Loc,
+       AS == AMDGPUAS::CONSTANT_ADDRESS_32BIT)
+     return ModRefInfo::NoModRef;
+ 
++  if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(Base)) {
++    if (GV->isConstant())
++      return ModRefInfo::NoModRef;
++  } else if (const Argument *Arg = dyn_cast<Argument>(Base)) {
++    const Function *F = Arg->getParent();
++
++    // Only assume constant memory for arguments on kernels.
++    switch (F->getCallingConv()) {
++    default:
++      return AAResultBase::getModRefInfoMask(Loc, AAQI, IgnoreLocals);
++    case CallingConv::AMDGPU_LS:
++    case CallingConv::AMDGPU_HS:
++    case CallingConv::AMDGPU_ES:
++    case CallingConv::AMDGPU_GS:
++    case CallingConv::AMDGPU_VS:
++    case CallingConv::AMDGPU_PS:
++    case CallingConv::AMDGPU_CS:
++    case CallingConv::AMDGPU_KERNEL:
++    case CallingConv::SPIR_KERNEL:
++      break;
++    }
++
++    unsigned ArgNo = Arg->getArgNo();
++    /* On an argument, ReadOnly attribute indicates that the function does
++       not write through this pointer argument, even though it may write
++       to the memory that the pointer points to.
++       On an argument, ReadNone attribute indicates that the function does
++       not dereference that pointer argument, even though it may read or write
++       the memory that the pointer points to if accessed through other pointers.
++     */
++    if (F->hasParamAttribute(ArgNo, Attribute::NoAlias) &&
++        (F->hasParamAttribute(ArgNo, Attribute::ReadNone) ||
++         F->hasParamAttribute(ArgNo, Attribute::ReadOnly))) {
++      return ModRefInfo::NoModRef;
++    }
++  }
+   return AAResultBase::getModRefInfoMask(Loc, AAQI, IgnoreLocals);
+ }
+-- 
+2.39.0
+
diff --git a/srcpkgs/llvm16/template b/srcpkgs/llvm16/template
new file mode 100644
index 000000000000..e1f9280b690b
--- /dev/null
+++ b/srcpkgs/llvm16/template
@@ -0,0 +1,455 @@
+# Template file for 'llvm16'
+pkgname=llvm16
+version=16.0.3
+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
+ -DLIBCXX_INCLUDE_DOCS=YES
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES
+ -DLIBOMP_ENABLE_SHARED=YES
+ -DLIBOMP_INSTALL_ALIASES=NO
+ -DLIBUNWIND_INCLUDE_DOCS=YES
+ -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="libllvm16>=${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=3b12e35332e10cf650578ae18247b91b04926d5427e1a6ae9a51d170a47cfbb2
+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;lld"
+_enabled_runtimes="compiler-rt;libcxx;libcxxabi;libunwind"
+
+_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 libllvm16"
+
+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}
+ -DLLVM_ENABLE_RUNTIMES=${_enabled_runtimes}"
+
+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
+}
+
+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} \
+			-DLLVM_ENABLE_RUNTIMES=${_enabled_runtimes}
+		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
+	arm*-musl|i686-musl)
+		# sanitizer code is broken since it duplicates some libc bits
+		configure_args+=" -DCOMPILER_RT_BUILD_SANITIZERS=OFF"
+		;;
+	esac
+
+	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/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
+	}
+}
+
+libllvm16_package() {
+	short_desc+=" - runtime library"
+	pkg_install() {
+		vmove "usr/lib/libLLVM-*.so*"
+	}
+}
diff --git a/srcpkgs/llvm16/update b/srcpkgs/llvm16/update
new file mode 100644
index 000000000000..e95cf26b3586
--- /dev/null
+++ b/srcpkgs/llvm16/update
@@ -0,0 +1,3 @@
+site="https://github.com/llvm/llvm-project/releases"
+pattern="llvmorg-\K(\d+.){2}\d+(-rc\d+)?"
+ignore="*-rc*"

From bfacd6d80206befc77d31d66d3209a274a63d3e9 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:51 +0200
Subject: [PATCH 02/21] CastXML: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/CastXML/template b/srcpkgs/CastXML/template
index de0920900ae4..323f61224ba9 100644
--- a/srcpkgs/CastXML/template
+++ b/srcpkgs/CastXML/template
@@ -1,7 +1,7 @@
 # Template file for 'CastXML'
 pkgname=CastXML
 version=0.5.1
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DSPHINX_MAN=YES -DCastXML_INSTALL_MAN_DIR=share/man"
 hostmakedepends="clang python3-Sphinx"

From 41a2942d587ec8bcd2e226e53af5067bf61df581 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:51 +0200
Subject: [PATCH 03/21] bcc: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/bcc/template b/srcpkgs/bcc/template
index 1b690066612f..970178656ddd 100644
--- a/srcpkgs/bcc/template
+++ b/srcpkgs/bcc/template
@@ -1,7 +1,7 @@
 # Template file for 'bcc'
 pkgname=bcc
 version=0.27.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DREVISION=${version} -DENABLE_LLVM_SHARED=1"
 hostmakedepends="flex python3-setuptools"

From 7bc29d3919b54e3c988169b93f02b869f9fd90b5 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:52 +0200
Subject: [PATCH 04/21] bpftrace: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/bpftrace/template b/srcpkgs/bpftrace/template
index ad1bd0f50e73..549e8ad670a1 100644
--- a/srcpkgs/bpftrace/template
+++ b/srcpkgs/bpftrace/template
@@ -1,7 +1,7 @@
 # Template file for 'bpftrace'
 pkgname=bpftrace
 version=0.17.1
-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 bff4539a69dfb42e82d54a1dfbf94b0f6688bf49 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:52 +0200
Subject: [PATCH 05/21] ccls: rebuild for llvm16-16.0.3_1

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

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

From d746d011a902f6b41c210d71a4d3a7329a2e757e Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:52 +0200
Subject: [PATCH 06/21] clazy: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/clazy/template b/srcpkgs/clazy/template
index f81de08ab836..bdec40488d6a 100644
--- a/srcpkgs/clazy/template
+++ b/srcpkgs/clazy/template
@@ -1,7 +1,7 @@
 # Template file for 'clazy'
 pkgname=clazy
 version=1.11
-revision=2
+revision=3
 build_style=cmake
 build_helper=qemu
 hostmakedepends="llvm"

From 8cb6006d1cee48fbbfbfc9138115b648957115c7 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:52 +0200
Subject: [PATCH 07/21] include-what-you-use: rebuild for llvm16-16.0.3_1

---
 srcpkgs/include-what-you-use/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/include-what-you-use/template b/srcpkgs/include-what-you-use/template
index 1a30bc04bb2d..b9190c260eda 100644
--- a/srcpkgs/include-what-you-use/template
+++ b/srcpkgs/include-what-you-use/template
@@ -1,7 +1,7 @@
 # Template file for 'include-what-you-use'
 pkgname=include-what-you-use
 version=0.19
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DIWYU_LLVM_ROOT_PATH=${XBPS_CROSS_BASE}/usr "
 hostmakedepends="python3"

From eaaa8758cb8292bf86ce819ed766415356ef7d37 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:52 +0200
Subject: [PATCH 08/21] ispc: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/ispc/template b/srcpkgs/ispc/template
index fbfa4f6db420..44489dee9a2e 100644
--- a/srcpkgs/ispc/template
+++ b/srcpkgs/ispc/template
@@ -1,7 +1,7 @@
 # Template file for 'ispc'
 pkgname=ispc
 version=1.19.0
-revision=2
+revision=3
 archs="aarch64* x86_64*"
 build_style=cmake
 configure_args="-DISPC_INCLUDE_EXAMPLES=OFF -DISPC_INCLUDE_RT=OFF"

From 5afcd9bdbe746ae97d1ebe0d5dbe697bddbcd83f Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:52 +0200
Subject: [PATCH 09/21] ldc: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/ldc/template b/srcpkgs/ldc/template
index f6d8b7ffbe98..90953ae27fcc 100644
--- a/srcpkgs/ldc/template
+++ b/srcpkgs/ldc/template
@@ -1,7 +1,7 @@
 # Template file for 'ldc'
 pkgname=ldc
 version=1.31.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="
  -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc
@@ -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 llvm15 perl pkg-config"
+hostmakedepends="dmd llvm16 perl pkg-config"
 makedepends="libcurl-devel libffi-devel ncurses-devel zlib-devel
  llvm-libunwind-devel"
 depends="ldc-runtime llvm-libunwind-devel"

From ab3e612e02b29678e3eb4195474595730554c775 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:53 +0200
Subject: [PATCH 10/21] mesa: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 132263d3599f..f95c2f2f5736 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=22.3.5
-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 e93a79a8d248983ab6a59f6aad9f748c68e99e14 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:53 +0200
Subject: [PATCH 11/21] qt6-tools: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/qt6-tools/template b/srcpkgs/qt6-tools/template
index d5ad1618e3a7..c49c69f73901 100644
--- a/srcpkgs/qt6-tools/template
+++ b/srcpkgs/qt6-tools/template
@@ -1,7 +1,7 @@
 # Template file for 'qt6-tools'
 pkgname=qt6-tools
 version=6.4.2
-revision=2
+revision=3
 build_style=cmake
 configure_args="-DEXTERNAL_GUMBO=ON -DLITEHTML_UTF8=ON -DUSE_ICU=ON
  -DQT_BUILD_SHARED_LIBS=ON -DQT_FEATURE_assistant=ON

From 4379a27ee0d0aad0e2046c2c01d17f8f1576e0b2 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:53 +0200
Subject: [PATCH 12/21] qtcreator: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/qtcreator/template b/srcpkgs/qtcreator/template
index b1dffd304198..046ca9cba57c 100644
--- a/srcpkgs/qtcreator/template
+++ b/srcpkgs/qtcreator/template
@@ -1,7 +1,7 @@
 # Template file for 'qtcreator'
 pkgname=qtcreator
 version=9.0.1
-revision=2
+revision=3
 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 6d379d643c13e54d95028ce8a8210385631599fa Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:23:53 +0200
Subject: [PATCH 13/21] rust: rebuild for llvm16-16.0.3_1

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

diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template
index 88e35a5a43ad..53de9ac72231 100644
--- a/srcpkgs/rust/template
+++ b/srcpkgs/rust/template
@@ -9,9 +9,9 @@
 #
 pkgname=rust
 version=1.69.0
-revision=1
+revision=2
 hostmakedepends="cmake curl pkg-config python3 tar cargo-bootstrap"
-makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm15"
+makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm16"
 depends="rust-std"
 short_desc="Safe, concurrent, practical systems language"
 maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -33,7 +33,7 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
 fi
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" rust llvm15"
+	hostmakedepends+=" rust llvm16"
 	# These are required for building the buildhost's stage0/1
 	hostmakedepends+=" libffi-devel libxml2-devel ncurses-devel zlib-devel"
 else

From 2f640724ed2a6cb873cfb737765e5cd31f1db2f3 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 13:28:52 +0200
Subject: [PATCH 14/21] llvm: update to 16.

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

diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index fc1c850bd26f..5a88372fb672 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -1,9 +1,9 @@
 # Template file for 'llvm'
 pkgname=llvm
-version=15
+version=16
 revision=1
 build_style=meta
-depends="llvm15"
+depends="llvm16"
 short_desc="LLVM meta package"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="Public Domain"

From 22c01bdaa3abd2b7201457224f7a229b46d9d0bd Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 21:14:16 +0200
Subject: [PATCH 15/21] SPIRV-Headers: update to 1.3.243.0.

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

diff --git a/srcpkgs/SPIRV-Headers/template b/srcpkgs/SPIRV-Headers/template
index 8bb7d5f8b1ae..e3bca40c95be 100644
--- a/srcpkgs/SPIRV-Headers/template
+++ b/srcpkgs/SPIRV-Headers/template
@@ -1,7 +1,7 @@
 # Template file for 'SPIRV-Headers'
 pkgname=SPIRV-Headers
 reverts="1.5.4.raytracing.fixed_1 1.5.3_2 1.5.3_1 1.5.1_1 1.4.1_1"
-version=1.3.231.1
+version=1.3.243.0
 revision=1
 build_style=cmake
 short_desc="Machine-readable files for the SPIR-V Registry"
@@ -9,7 +9,7 @@ maintainer="tibequadorian <tibequadorian@posteo.de>"
 license="MIT"
 homepage="https://github.com/KhronosGroup/SPIRV-Headers"
 distfiles="https://github.com/KhronosGroup/SPIRV-Headers/archive/sdk-${version}.tar.gz"
-checksum=fc340700b005e9a2adc98475b5afbbabd1bc931f789a2afd02d54ebc22522af3
+checksum=16927b1868e7891377d059cd549484e4158912439cf77451ae7e01e2a3bcd28b
 
 post_install() {
 	vlicense LICENSE

From 5e34207130d3e5c69374c8b0c76da0fb38b9dbdf Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 21:14:28 +0200
Subject: [PATCH 16/21] SPIRV-Tools: update to 2023.2.

---
 srcpkgs/SPIRV-Tools/template | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/SPIRV-Tools/template b/srcpkgs/SPIRV-Tools/template
index 6a280baa0c28..b9b2ddbc2328 100644
--- a/srcpkgs/SPIRV-Tools/template
+++ b/srcpkgs/SPIRV-Tools/template
@@ -1,9 +1,11 @@
 # Template file for 'SPIRV-Tools'
 pkgname=SPIRV-Tools
-version=2022.4
+version=2023.2
 revision=1
 build_style=cmake
-configure_args="-DSPIRV_SKIP_TESTS=ON -DSPIRV_WERROR=OFF
+configure_args="
+ -DSPIRV_SKIP_TESTS=ON
+ -DSPIRV_WERROR=OFF
  -DSPIRV-Headers_SOURCE_DIR=${XBPS_CROSS_BASE}/usr"
 hostmakedepends="python3"
 makedepends="SPIRV-Headers"
@@ -13,8 +15,7 @@ license="Apache-2.0"
 homepage="https://github.com/KhronosGroup/SPIRV-Tools"
 changelog="https://raw.githubusercontent.com/KhronosGroup/SPIRV-Tools/master/CHANGES"
 distfiles="https://github.com/KhronosGroup/SPIRV-Tools/archive/v${version}.tar.gz"
-checksum=a156215a2d7c6c5b267933ed691877a9a66f07d75970da33ce9ad627a71389d7
-LDFLAGS="-Wl,--no-undefined"
+checksum=7416cc8a98a10c32bacc36a39930b0c5b2a484963df5d68f388ed7ffee1faad3
 
 SPIRV-Tools-devel_package() {
 	depends="SPIRV-Tools-${version}_${revision}"

From da737e4d8bdf6204cbea631d819035dc2af2d3d9 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 21:14:33 +0200
Subject: [PATCH 17/21] SPIRV-LLVM-Translator: update to 16.0.0.

---
 ...anslator-16.0.0-llvm-link-llvm-dylib.patch | 73 +++++++++++++++++++
 srcpkgs/SPIRV-LLVM-Translator/template        | 17 +++--
 2 files changed, 83 insertions(+), 7 deletions(-)
 create mode 100644 srcpkgs/SPIRV-LLVM-Translator/patches/spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch

diff --git a/srcpkgs/SPIRV-LLVM-Translator/patches/spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch b/srcpkgs/SPIRV-LLVM-Translator/patches/spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch
new file mode 100644
index 000000000000..5cd90086f1e2
--- /dev/null
+++ b/srcpkgs/SPIRV-LLVM-Translator/patches/spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch
@@ -0,0 +1,73 @@
+From 98fadafeae0204defedd89f015f7fb88f2888b2f Mon Sep 17 00:00:00 2001
+From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
+Date: Fri, 17 Mar 2023 14:27:10 -0300
+Subject: [PATCH] Fix standalone builds with LLVM_LINK_LLVM_DYLIB=ON
+
+Move the LLVM components to LINK_COMPONENTS because the DEPENDS list has
+the same semantics as add_dependencies(). In this
+case it doesn't include the LLVM components when calling the linker.
+---
+ lib/SPIRV/CMakeLists.txt | 47 ++++++++++++----------------------------
+ 1 file changed, 14 insertions(+), 33 deletions(-)
+
+diff --git a/lib/SPIRV/CMakeLists.txt b/lib/SPIRV/CMakeLists.txt
+index bbef00528..2810c6b2c 100644
+--- a/lib/SPIRV/CMakeLists.txt
++++ b/lib/SPIRV/CMakeLists.txt
+@@ -38,42 +38,23 @@ set(SRC_LIST
+   libSPIRV/SPIRVType.cpp
+   libSPIRV/SPIRVValue.cpp
+ )
+-if(LLVM_LINK_LLVM_DYLIB)
+-  add_llvm_library(LLVMSPIRVLib STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
+-    ${SRC_LIST}
+-    DEPENDS
+-      intrinsics_gen
+-      LLVMAnalysis
+-      LLVMBitWriter
+-      LLVMCodeGen
+-      LLVMCore
+-      LLVMDemangle
+-      LLVMIRReader
+-      LLVMLinker
+-      LLVMPasses
+-      LLVMSupport
+-      LLVMTargetParser
+-      LLVMTransformUtils
+-  )
+-else()
+-  add_llvm_library(LLVMSPIRVLib
+-    ${SRC_LIST}
+-    LINK_COMPONENTS
+-      Analysis
+-      BitWriter
+-      CodeGen
+-      Core
+-      Demangle
+-      IRReader
+-      Linker
+-      Passes
+-      Support
+-      TargetParser
+-      TransformUtils
++add_llvm_library(LLVMSPIRVLib
++  ${SRC_LIST}
++  LINK_COMPONENTS
++    Analysis
++    BitWriter
++    CodeGen
++    Core
++    Demangle
++    IRReader
++    Linker
++    Passes
++    Support
++    TargetParser
++    TransformUtils
+   DEPENDS
+     intrinsics_gen
+   )
+-endif()
+ 
+ target_include_directories(LLVMSPIRVLib
+   PRIVATE
diff --git a/srcpkgs/SPIRV-LLVM-Translator/template b/srcpkgs/SPIRV-LLVM-Translator/template
index bee99f9bcbb2..1bdb54aad707 100644
--- a/srcpkgs/SPIRV-LLVM-Translator/template
+++ b/srcpkgs/SPIRV-LLVM-Translator/template
@@ -1,20 +1,23 @@
 # Template file for 'SPIRV-LLVM-Translator'
 pkgname=SPIRV-LLVM-Translator
-version=15.0.0
+version=16.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
+# 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_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr"
-hostmakedepends="clang llvm"
-makedepends="clang-tools-extra llvm SPIRV-Headers"
+hostmakedepends="clang llvm16"
+makedepends="clang-tools-extra llvm16 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/SPIRV-LLVM-Translator/archive/refs/tags/v${version}.tar.gz"
-checksum=b1bebd77f72988758c00852e78c2ddc545815a612169a0cb377d021e2f846d88
+checksum=305fac5bb8efdad9054f0d27b5b765aca8b3349a500e2ba0c927763e42badc2b
 
 post_install() {
 	vlicense LICENSE.TXT

From 93203edcaa27e3e5df6a5f521634b254d05d119b Mon Sep 17 00:00:00 2001
From: Arda Demir <ddmirarda@gmail.com>
Date: Thu, 23 Feb 2023 12:31:16 +0300
Subject: [PATCH 18/21] mesa: update to 23.0.3.

---
 ...e5677f36c3b0b8e8ea199ed4f2c7fad06d47.patch | 77 -------------------
 srcpkgs/mesa/template                         | 10 +--
 2 files changed, 5 insertions(+), 82 deletions(-)
 delete mode 100644 srcpkgs/mesa/patches/c426e5677f36c3b0b8e8ea199ed4f2c7fad06d47.patch

diff --git a/srcpkgs/mesa/patches/c426e5677f36c3b0b8e8ea199ed4f2c7fad06d47.patch b/srcpkgs/mesa/patches/c426e5677f36c3b0b8e8ea199ed4f2c7fad06d47.patch
deleted file mode 100644
index f56327367526..000000000000
--- a/srcpkgs/mesa/patches/c426e5677f36c3b0b8e8ea199ed4f2c7fad06d47.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From c426e5677f36c3b0b8e8ea199ed4f2c7fad06d47 Mon Sep 17 00:00:00 2001
-From: Erico Nunes <nunes.erico@gmail.com>
-Date: Sun, 12 Feb 2023 22:33:30 +0100
-Subject: [PATCH] lima: don't use resource_from_handle while creating scanout
-
-resource_from_handle implementations create an additional reference to
-the scanout resource, which caused lima to leak those resources after
-commit ad4d7ca8332488be8a75aff001f00306a9f6402e.
-
-Do as the other drivers do and import the bo directly while creating
-the scanount resource.
-
-Cc: 22.3 mesa-stable
-Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8198
-Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
-Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21330>
----
- src/gallium/drivers/lima/lima_resource.c | 26 ++++++++++++++++++------
- 1 file changed, 20 insertions(+), 6 deletions(-)
-
-diff --git a/src/gallium/drivers/lima/lima_resource.c b/src/gallium/drivers/lima/lima_resource.c
-index 54869ec03d24..0b7691f2b46f 100644
---- a/src/gallium/drivers/lima/lima_resource.c
-+++ b/src/gallium/drivers/lima/lima_resource.c
-@@ -59,7 +59,10 @@ lima_resource_create_scanout(struct pipe_screen *pscreen,
-    struct lima_screen *screen = lima_screen(pscreen);
-    struct renderonly_scanout *scanout;
-    struct winsys_handle handle;
--   struct pipe_resource *pres;
-+
-+   struct lima_resource *res = CALLOC_STRUCT(lima_resource);
-+   if (!res)
-+      return NULL;
- 
-    struct pipe_resource scanout_templat = *templat;
-    scanout_templat.width0 = width;
-@@ -71,20 +74,31 @@ lima_resource_create_scanout(struct pipe_screen *pscreen,
-    if (!scanout)
-       return NULL;
- 
-+   res->base = *templat;
-+   res->base.screen = pscreen;
-+   pipe_reference_init(&res->base.reference, 1);
-+   res->levels[0].offset = handle.offset;
-+   res->levels[0].stride = handle.stride;
-+
-    assert(handle.type == WINSYS_HANDLE_TYPE_FD);
--   pres = pscreen->resource_from_handle(pscreen, templat, &handle,
--                                        PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE);
-+   res->bo = lima_bo_import(screen, &handle);
-+   if (!res->bo) {
-+      FREE(res);
-+      return NULL;
-+   }
-+
-+   res->modifier_constant = true;
- 
-    close(handle.handle);
--   if (!pres) {
-+   if (!res->bo) {
-       renderonly_scanout_destroy(scanout, screen->ro);
-+      FREE(res);
-       return NULL;
-    }
- 
--   struct lima_resource *res = lima_resource(pres);
-    res->scanout = scanout;
- 
--   return pres;
-+   return &res->base;
- }
- 
- static uint32_t
--- 
-GitLab
-
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index f95c2f2f5736..8306d8a534db 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,12 +1,12 @@
 # Template file for 'mesa'
 pkgname=mesa
-version=22.3.5
-revision=3
+version=23.0.3
+revision=1
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
  -Dlmsensors=enabled -Dplatforms=x11$(vopt_if wayland ,wayland)
- -Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++14"
+ -Dllvm=enabled -Db_lto=false"
 hostmakedepends="gettext flex llvm pkg-config python3-Mako glslang
  $(vopt_if wayland 'wayland-protocols wayland-devel')"
 makedepends="elfutils-devel expat-devel libXdamage-devel
@@ -16,13 +16,13 @@ makedepends="elfutils-devel expat-devel libXdamage-devel
  libXrandr-devel libglvnd-devel libzstd-devel libxml2-devel lua53-devel
  libarchive-devel"
 depends="libglvnd"
-short_desc="Graphics library similar to SGI's OpenGL"
+short_desc="Open source implementation of OpenGL and Vulkan specifications"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, LGPL-2.1-or-later"
 homepage="https://www.mesa3d.org/"
 changelog="https://docs.mesa3d.org/relnotes.html"
 distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
-checksum=3eed2ecae2bc674494566faab9fcc9beb21cd804c7ba2b59a1694f3d7236e6a9
+checksum=386362a5d80df3b096636b67f340e1ce67b705b44767d5bdd11d2ed1037192d5
 
 build_options="wayland"
 build_options_default="wayland"

From 0e4b3d2065f924da484c3e075e0e682b3f7f932d Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 21:42:58 +0200
Subject: [PATCH 19/21] fixup! SPIRV-LLVM-Translator: update to 16.0.0.

---
 common/shlibs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/shlibs b/common/shlibs
index 85617f9a4884..cef93167ad88 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -997,7 +997,7 @@ libLLVM-11.so libllvm11-11.0.0_1
 libLLVM-12.so libllvm12-12.0.0_1
 libLLVM-15.so libllvm15-15.0.7_1
 libLLVM-16.so libllvm16-16.0.3_1
-libLLVMSPIRVLib.so.16 SPIRV-LLVM-Translator-16.0.3_1
+libLLVMSPIRVLib.so.16 SPIRV-LLVM-Translator-16.0.0_1
 libomp.so.5 libomp-15.0.7_1
 libomptarget.so.16 libomp-16.0.7_1
 libisofs.so.6 libisofs-0.6.24_1

From c65516e674dc80bb99603453d11c0c8624dec029 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 21:43:14 +0200
Subject: [PATCH 20/21] fixup! bpftrace: rebuild for llvm16-16.0.3_1

---
 ...22cb14e2eedc5df17e53965824d7381f8e6f.patch | 41 +++++++++++++++++++
 ...7872b0c6600b69c5766ef7bdf736dd73ce9c.patch | 23 +++++++++++
 2 files changed, 64 insertions(+)
 create mode 100644 srcpkgs/bpftrace/patches/70ee22cb14e2eedc5df17e53965824d7381f8e6f.patch
 create mode 100644 srcpkgs/bpftrace/patches/7eea7872b0c6600b69c5766ef7bdf736dd73ce9c.patch

diff --git a/srcpkgs/bpftrace/patches/70ee22cb14e2eedc5df17e53965824d7381f8e6f.patch b/srcpkgs/bpftrace/patches/70ee22cb14e2eedc5df17e53965824d7381f8e6f.patch
new file mode 100644
index 000000000000..2173cc81376a
--- /dev/null
+++ b/srcpkgs/bpftrace/patches/70ee22cb14e2eedc5df17e53965824d7381f8e6f.patch
@@ -0,0 +1,41 @@
+From 70ee22cb14e2eedc5df17e53965824d7381f8e6f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Mar 2023 21:30:27 -0700
+Subject: [PATCH] ast: Use std::optional in CodegenLLVM::CodegenLLVM call
+
+Fixes build with clang-16
+
+src/ast/passes/codegen_llvm.cpp:63:53: error: use of undeclared identifier 'Optional'; did you mean 'std::optional'?
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/ast/passes/codegen_llvm.cpp | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/ast/passes/codegen_llvm.cpp b/src/ast/passes/codegen_llvm.cpp
+index 616ff89ddbc..fe440adf373 100644
+--- a/src/ast/passes/codegen_llvm.cpp
++++ b/src/ast/passes/codegen_llvm.cpp
+@@ -56,11 +56,17 @@ CodegenLLVM::CodegenLLVM(Node *root, BPFtrace &bpftrace)
+     throw std::runtime_error(
+         "Could not find bpf llvm target, does your llvm support it?");
+ 
+-  target_machine_.reset(target->createTargetMachine(LLVMTargetTriple,
+-                                                    "generic",
+-                                                    "",
+-                                                    TargetOptions(),
+-                                                    Optional<Reloc::Model>()));
++  target_machine_.reset(
++      target->createTargetMachine(LLVMTargetTriple,
++                                  "generic",
++                                  "",
++                                  TargetOptions(),
++#if LLVM_VERSION_MAJOR >= 16
++                                  std::optional<Reloc::Model>()
++#else
++                                  Optional<Reloc::Model>()
++#endif
++                                      ));
+   target_machine_->setOptLevel(llvm::CodeGenOpt::Aggressive);
+ 
+   module_->setTargetTriple(LLVMTargetTriple);
diff --git a/srcpkgs/bpftrace/patches/7eea7872b0c6600b69c5766ef7bdf736dd73ce9c.patch b/srcpkgs/bpftrace/patches/7eea7872b0c6600b69c5766ef7bdf736dd73ce9c.patch
new file mode 100644
index 000000000000..b95a1c8df984
--- /dev/null
+++ b/srcpkgs/bpftrace/patches/7eea7872b0c6600b69c5766ef7bdf736dd73ce9c.patch
@@ -0,0 +1,23 @@
+From 7eea7872b0c6600b69c5766ef7bdf736dd73ce9c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 10 Mar 2023 00:08:27 -0800
+Subject: [PATCH] cmake: Raise max llvm major version to 16
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index db5618e4efb..5cc489afe44 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -173,7 +173,7 @@ else()
+   endif()
+ 
+   set(MIN_LLVM_MAJOR 6)
+-  set(MAX_LLVM_MAJOR 15)
++  set(MAX_LLVM_MAJOR 16)
+ 
+   if((${LLVM_VERSION_MAJOR} VERSION_LESS ${MIN_LLVM_MAJOR}) OR (${LLVM_VERSION_MAJOR} VERSION_GREATER ${MAX_LLVM_MAJOR}))
+     message(SEND_ERROR "Unsupported LLVM version found via ${LLVM_INCLUDE_DIRS}: ${LLVM_VERSION_MAJOR}")

From a741228a98962e0b75567505476ac2c2b8b9204d Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Thu, 4 May 2023 21:44:32 +0200
Subject: [PATCH 21/21] fixup! New package: llvm16-16.0.3

---
 common/shlibs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index cef93167ad88..64deae182e63 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -990,7 +990,7 @@ 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.16 lldb-16.0.7_1
+liblldb.so.16 lldb-16.0.3_1
 libclang.so.16 libclang-16.0.3_1
 libclang-cpp.so.16 libclang-cpp-16.0.3_1
 libLLVM-11.so libllvm11-11.0.0_1
@@ -999,7 +999,7 @@ libLLVM-15.so libllvm15-15.0.7_1
 libLLVM-16.so libllvm16-16.0.3_1
 libLLVMSPIRVLib.so.16 SPIRV-LLVM-Translator-16.0.0_1
 libomp.so.5 libomp-15.0.7_1
-libomptarget.so.16 libomp-16.0.7_1
+libomptarget.so.16 libomp-16.0.3_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

  parent reply	other threads:[~2023-05-04 19:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 23:51 [PR PATCH] " Duncaen
2023-05-04  1:10 ` [PR PATCH] [Updated] " Duncaen
2023-05-04  1:12 ` Duncaen
2023-05-04  1:21 ` Duncaen
2023-05-04  1:34 ` Duncaen
2023-05-04 11:33 ` Duncaen
2023-05-04 11:40 ` Duncaen
2023-05-04 19:41 ` Duncaen
2023-05-04 19:43 ` Duncaen
2023-05-04 19:44 ` Duncaen [this message]
2023-05-04 22:43 ` Duncaen
2023-05-05 19:24 ` Duncaen
2023-05-05 19:25 ` Duncaen
2023-05-05 19:27 ` Duncaen
2023-07-05  4:14 ` wozniak
2023-10-04  1:45 ` github-actions
2023-10-19  1:45 ` [PR PATCH] [Closed]: " github-actions

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230504194440.gsTcrn4OzuHxOgaHgI2mepMxcnK7X0ug2Lf2yRBzsvA@z \
    --to=duncaen@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).